@@ -190,9 +190,9 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec:
190
190
if not isinstance (result , BytesBytesCodec ):
191
191
msg = f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a { type (result )} instead."
192
192
raise TypeError (msg )
193
+ elif not isinstance (data , BytesBytesCodec ):
194
+ raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
193
195
else :
194
- if not isinstance (data , BytesBytesCodec ):
195
- raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
196
196
result = data
197
197
return result
198
198
@@ -210,9 +210,9 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec:
210
210
if not isinstance (result , ArrayBytesCodec ):
211
211
msg = f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a { type (result )} instead."
212
212
raise TypeError (msg )
213
+ elif not isinstance (data , ArrayBytesCodec ):
214
+ raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
213
215
else :
214
- if not isinstance (data , ArrayBytesCodec ):
215
- raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
216
216
result = data
217
217
return result
218
218
@@ -230,9 +230,9 @@ def _parse_array_array_codec(data: dict[str, JSON] | Codec) -> ArrayArrayCodec:
230
230
if not isinstance (result , ArrayArrayCodec ):
231
231
msg = f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a { type (result )} instead."
232
232
raise TypeError (msg )
233
+ elif not isinstance (data , ArrayArrayCodec ):
234
+ raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
233
235
else :
234
- if not isinstance (data , ArrayArrayCodec ):
235
- raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
236
236
result = data
237
237
return result
238
238
0 commit comments