@@ -2262,10 +2262,7 @@ def _is_type_specification(obj):
22622262 continue
22632263 try :
22642264 awkward .types .from_datashape (obj , highlevel = False )
2265- except (
2266- awkward .types ._awkward_datashape_parser .UnexpectedToken ,
2267- awkward .types ._awkward_datashape_parser .UnexpectedCharacters ,
2268- ):
2265+ except Exception :
22692266 pass
22702267 else :
22712268 continue
@@ -2282,9 +2279,7 @@ def _type_specification_to_awkward_form(obj):
22822279 try :
22832280 obj = numpy .dtype (obj )
22842281 except (TypeError , ValueError ):
2285- raise TypeError (
2286- f"Cannot construct a NumPy dtype from { obj !r} of type { type (obj ).__name__ } ."
2287- ) from None
2282+ raise TypeError (f"Cannot construct a NumPy dtype from { obj !r} ." ) from None
22882283 if isinstance (obj , tuple ):
22892284 try :
22902285 obj = numpy .dtype (obj )
@@ -2294,7 +2289,7 @@ def _type_specification_to_awkward_form(obj):
22942289 ) from None
22952290 if isinstance (obj , str ):
22962291 # First we try to interpret the string as a NumPy dtype
2297- # so we can try to convert it to a string Awkward unterstands
2292+ # so we can try to convert it to a string Awkward understands
22982293 try :
22992294 dt = numpy .dtype (obj )
23002295 except (TypeError , ValueError ):
@@ -2316,10 +2311,7 @@ def _type_specification_to_awkward_form(obj):
23162311 return awkward .forms .from_type (
23172312 awkward .types .from_datashape (obj , highlevel = False )
23182313 )
2319- except (
2320- awkward .types ._awkward_datashape_parser .UnexpectedToken ,
2321- awkward .types ._awkward_datashape_parser .UnexpectedCharacters ,
2322- ):
2314+ except Exception :
23232315 raise TypeError (
23242316 f"Cannot construct an Awkward Form from type specification { obj !r} "
23252317 ) from None
0 commit comments