@@ -179,9 +179,9 @@ def _parse_bytes_bytes_codec(data: dict[str, JSON] | Codec) -> BytesBytesCodec:
179
179
if not isinstance (result , BytesBytesCodec ):
180
180
msg = f"Expected a dict representation of a BytesBytesCodec; got a dict representation of a { type (result )} instead."
181
181
raise TypeError (msg )
182
+ elif not isinstance (data , BytesBytesCodec ):
183
+ raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
182
184
else :
183
- if not isinstance (data , BytesBytesCodec ):
184
- raise TypeError (f"Expected a BytesBytesCodec. Got { type (data )} instead." )
185
185
result = data
186
186
return result
187
187
@@ -199,9 +199,9 @@ def _parse_array_bytes_codec(data: dict[str, JSON] | Codec) -> ArrayBytesCodec:
199
199
if not isinstance (result , ArrayBytesCodec ):
200
200
msg = f"Expected a dict representation of a ArrayBytesCodec; got a dict representation of a { type (result )} instead."
201
201
raise TypeError (msg )
202
+ elif not isinstance (data , ArrayBytesCodec ):
203
+ raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
202
204
else :
203
- if not isinstance (data , ArrayBytesCodec ):
204
- raise TypeError (f"Expected a ArrayBytesCodec. Got { type (data )} instead." )
205
205
result = data
206
206
return result
207
207
@@ -219,9 +219,9 @@ def _parse_array_array_codec(data: dict[str, JSON] | Codec) -> ArrayArrayCodec:
219
219
if not isinstance (result , ArrayArrayCodec ):
220
220
msg = f"Expected a dict representation of a ArrayArrayCodec; got a dict representation of a { type (result )} instead."
221
221
raise TypeError (msg )
222
+ elif not isinstance (data , ArrayArrayCodec ):
223
+ raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
222
224
else :
223
- if not isinstance (data , ArrayArrayCodec ):
224
- raise TypeError (f"Expected a ArrayArrayCodec. Got { type (data )} instead." )
225
225
result = data
226
226
return result
227
227
0 commit comments