Skip to content

Commit

Permalink
Workaround incorrect __module__
Browse files Browse the repository at this point in the history
  • Loading branch information
altendky committed Aug 16, 2020
1 parent 3da3f3f commit faf3214
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx_autodoc_typehints.py
Expand Up @@ -204,7 +204,7 @@ def get_all_type_hints(obj, name):

try:
rv = get_type_hints(obj)
except (AttributeError, TypeError, RecursionError):
except (AttributeError, TypeError, RecursionError, KeyError):
# Introspecting a slot wrapper will raise TypeError, and and some recursive type
# definitions will cause a RecursionError (https://github.com/python/typing/issues/574).
pass
Expand All @@ -225,7 +225,7 @@ def get_all_type_hints(obj, name):

try:
rv = get_type_hints(obj)
except (AttributeError, TypeError):
except (AttributeError, TypeError, KeyError):
pass
except NameError as exc:
logger.warning('Cannot resolve forward reference in type annotations of "%s": %s',
Expand Down

0 comments on commit faf3214

Please sign in to comment.