@@ -179,9 +179,9 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec:
179179 if not isinstance (result , BytesBytesCodec ):
180180 msg = f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a { type (result )} instead."
181181 raise TypeError (msg )
182+ elif not isinstance (data , BytesBytesCodec ):
183+ raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
182184 else :
183- if not isinstance (data , BytesBytesCodec ):
184- raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
185185 result = data
186186 return result
187187
@@ -199,9 +199,9 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec:
199199 if not isinstance (result , ArrayBytesCodec ):
200200 msg = f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a { type (result )} instead."
201201 raise TypeError (msg )
202+ elif not isinstance (data , ArrayBytesCodec ):
203+ raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
202204 else :
203- if not isinstance (data , ArrayBytesCodec ):
204- raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
205205 result = data
206206 return result
207207
@@ -219,9 +219,9 @@ def _parse_array_array_codec(data: dict[str, JSON] | Codec) -> ArrayArrayCodec:
219219 if not isinstance (result , ArrayArrayCodec ):
220220 msg = f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a { type (result )} instead."
221221 raise TypeError (msg )
222+ elif not isinstance (data , ArrayArrayCodec ):
223+ raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
222224 else :
223- if not isinstance (data , ArrayArrayCodec ):
224- raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
225225 result = data
226226 return result
227227
0 commit comments