Skip to content

Commit 626d706

Browse files
Minor edit for code clarification in annotationlib. (python#124805)
1 parent 7e7223e commit 626d706

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Lib/annotationlib.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -685,11 +685,9 @@ def get_annotations(
685685
case Format.FORWARDREF:
686686
# For FORWARDREF, we use __annotations__ if it exists
687687
try:
688-
ann = _get_dunder_annotations(obj)
688+
return dict(_get_dunder_annotations(obj))
689689
except NameError:
690690
pass
691-
else:
692-
return dict(ann)
693691

694692
# But if __annotations__ threw a NameError, we try calling __annotate__
695693
ann = _get_and_call_annotate(obj, format)

0 commit comments

Comments
 (0)