Skip to content

Commit 59f391f

Browse files
committed
Last tweak
1 parent 08526e2 commit 59f391f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/uproot/writing/writable.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,10 +2276,9 @@ def _type_specification_to_awkward_form(obj):
22762276
if isinstance(obj, (awkward.types.Type, awkward.types.ArrayType)):
22772277
return awkward.forms.from_type(obj)
22782278
if isinstance(obj, type):
2279-
try:
2280-
obj = numpy.dtype(obj)
2281-
except (TypeError, ValueError):
2282-
raise TypeError(f"Cannot construct a NumPy dtype from {obj!r}.") from None
2279+
obj = numpy.dtype(obj)
2280+
if obj == numpy.dtype("O"):
2281+
raise TypeError(f"Cannot construct a NumPy dtype from {obj!r}.")
22832282
if isinstance(obj, tuple):
22842283
try:
22852284
obj = numpy.dtype(obj)

0 commit comments

Comments
 (0)