mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2025-01-10 13:54:26 +00:00
don't try and access __name__ on typing classes
This commit is contained in:
parent
49a51563d6
commit
7fee64ada6
1 changed files with 4 additions and 1 deletions
|
@ -140,7 +140,10 @@ class NDArray(NPTypingType, metaclass=NDArrayMeta):
|
||||||
json_schema = handler.resolve_ref_schema(json_schema)
|
json_schema = handler.resolve_ref_schema(json_schema)
|
||||||
|
|
||||||
dtype = cls.__args__[1]
|
dtype = cls.__args__[1]
|
||||||
if not isinstance(dtype, tuple) and dtype.__module__ != "builtins":
|
if not isinstance(dtype, tuple) and dtype.__module__ not in (
|
||||||
|
"builtins",
|
||||||
|
"typing",
|
||||||
|
):
|
||||||
json_schema["dtype"] = ".".join([dtype.__module__, dtype.__name__])
|
json_schema["dtype"] = ".".join([dtype.__module__, dtype.__name__])
|
||||||
|
|
||||||
return json_schema
|
return json_schema
|
||||||
|
|
Loading…
Reference in a new issue