summaryrefslogtreecommitdiffstats
path: root/Lib/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/typing.py')
-rw-r--r--Lib/typing.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/typing.py b/Lib/typing.py
index e5d14b0..08b2ba3 100644
--- a/Lib/typing.py
+++ b/Lib/typing.py
@@ -1801,7 +1801,9 @@ def _get_protocol_attrs(cls):
for base in cls.__mro__[:-1]: # without object
if base.__name__ in {'Protocol', 'Generic'}:
continue
- annotations = getattr(base, '__annotations__', {})
+ annotations = _lazy_annotationlib.get_annotations(
+ base, format=_lazy_annotationlib.Format.FORWARDREF
+ )
for attr in (*base.__dict__, *annotations):
if not attr.startswith('_abc_') and attr not in EXCLUDED_ATTRIBUTES:
attrs.add(attr)