summaryrefslogtreecommitdiff
path: root/Lib/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index 583438e474..dc2a7a4788 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1628,7 +1628,10 @@ def get_type_hints(obj, globalns=None, localns=None, include_extras=False):
hints = {}
for base in reversed(obj.__mro__):
if globalns is None:
- base_globals = sys.modules[base.__module__].__dict__
+ try:
+ base_globals = sys.modules[base.__module__].__dict__
+ except KeyError:
+ continue
else:
base_globals = globalns
ann = base.__dict__.get('__annotations__', {})