We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 08526e2 commit 59f391fCopy full SHA for 59f391f
src/uproot/writing/writable.py
@@ -2276,10 +2276,9 @@ def _type_specification_to_awkward_form(obj):
2276
if isinstance(obj, (awkward.types.Type, awkward.types.ArrayType)):
2277
return awkward.forms.from_type(obj)
2278
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
+ obj = numpy.dtype(obj)
+ if obj == numpy.dtype("O"):
+ raise TypeError(f"Cannot construct a NumPy dtype from {obj!r}.")
2283
if isinstance(obj, tuple):
2284
try:
2285
obj = numpy.dtype(obj)
0 commit comments