Skip to content

Commit

Permalink
big comment
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed Nov 17, 2023
1 parent ed53fcb commit c2c65c6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,11 @@ def __new__(cls, typename, bases, ns):
setattr(nm_tpl, key, val)
try:
set_name = type(val).__set_name__
# Emulate as much as possible the behaviour of type_new_set_names
# in Objects/typeobject.c: if any exception is raised
# while attempting to access a __set_name__ attribute,
# swallow the exception and move on.
# (We could possibly catch BaseException here, but that feels wrong.)
except Exception:
pass
else:
Expand Down

0 comments on commit c2c65c6

Please sign in to comment.