Skip to content

Commit ff5e885

Browse files
committed
fixup! pythongh-115165: Fix Annotated for immutable types
Add comment justifying `except Exception`
1 parent 1d7e6e5 commit ff5e885

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎Lib/typing.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,8 @@ def __call__(self, *args, **kwargs):
11271127
result = self.__origin__(*args, **kwargs)
11281128
try:
11291129
result.__orig_class__ = self
1130+
# Some objects raise TypeError (or something even more exotic)
1131+
# if you try to set attributes on them; guarding against that here
11301132
except Exception:
11311133
pass
11321134
return result

0 commit comments

Comments
 (0)