Skip to content

Commit 29921d9

Browse files
spacemanspiff2007-
authored and
-
committed
Update __init__.py
1 parent 190d877 commit 29921d9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sphinx_autodoc_typehints/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,16 @@
3838
def _get_types_type(obj: Any) -> str | None:
3939
try:
4040
return _TYPES_DICT.get(obj)
41-
except TypeError:
41+
except:
4242
# e.g. exception: unhashable type
4343
return None
4444

4545

4646
def get_annotation_module(annotation: Any) -> str:
47-
if _get_types_type(annotation) is not None:
48-
return "types"
4947
if annotation is None:
5048
return "builtins"
49+
if _get_types_type(annotation) is not None:
50+
return "types"
5151
is_new_type = sys.version_info >= (3, 10) and isinstance(annotation, NewType)
5252
if (
5353
is_new_type

0 commit comments

Comments
 (0)