@@ -190,9 +190,9 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec:
190190 if not isinstance (result , BytesBytesCodec ):
191191 msg = f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a { type (result )} instead."
192192 raise TypeError (msg )
193+ elif not isinstance (data , BytesBytesCodec ):
194+ raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
193195 else :
194- if not isinstance (data , BytesBytesCodec ):
195- raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
196196 result = data
197197 return result
198198
@@ -210,9 +210,9 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec:
210210 if not isinstance (result , ArrayBytesCodec ):
211211 msg = f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a { type (result )} instead."
212212 raise TypeError (msg )
213+ elif not isinstance (data , ArrayBytesCodec ):
214+ raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
213215 else :
214- if not isinstance (data , ArrayBytesCodec ):
215- raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
216216 result = data
217217 return result
218218
@@ -230,9 +230,9 @@ def _parse_array_array_codec(data: dict[str, JSON] | Codec) -> ArrayArrayCodec:
230230 if not isinstance (result , ArrayArrayCodec ):
231231 msg = f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a { type (result )} instead."
232232 raise TypeError (msg )
233+ elif not isinstance (data , ArrayArrayCodec ):
234+ raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
233235 else :
234- if not isinstance (data , ArrayArrayCodec ):
235- raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
236236 result = data
237237 return result
238238
0 commit comments