aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/Lib/enum.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.com>2024-12-23 19:39:02 +0300
committershadchin <shadchin@yandex-team.com>2024-12-23 19:54:20 +0300
commit65a5bf9d37a3b29eb394f560b9a09318196c40e8 (patch)
treee5cd68fb0682b2388e52d9806bb87adc348e21a8 /contrib/tools/python3/Lib/enum.py
parenta1dd87a52878ab3e46e5fd2dba5ecbba6113d7e0 (diff)
downloadydb-65a5bf9d37a3b29eb394f560b9a09318196c40e8.tar.gz
Update Python 3 to 3.12.8
commit_hash:c20045b8a987d8720e1f3328270357491d5530f3
Diffstat (limited to 'contrib/tools/python3/Lib/enum.py')
-rw-r--r--contrib/tools/python3/Lib/enum.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/contrib/tools/python3/Lib/enum.py b/contrib/tools/python3/Lib/enum.py
index d9859b3c0a..eaa517e2fb 100644
--- a/contrib/tools/python3/Lib/enum.py
+++ b/contrib/tools/python3/Lib/enum.py
@@ -592,19 +592,13 @@ class EnumType(type):
classdict['_all_bits_'] = 0
classdict['_inverted_'] = None
try:
- exc = None
enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
except Exception as e:
- # since 3.12 the line "Error calling __set_name__ on '_proto_member' instance ..."
- # is tacked on to the error instead of raising a RuntimeError
- # recreate the exception to discard
- exc = type(e)(str(e))
- exc.__cause__ = e.__cause__
- exc.__context__ = e.__context__
- tb = e.__traceback__
- if exc is not None:
- raise exc.with_traceback(tb)
- #
+ # since 3.12 the note "Error calling __set_name__ on '_proto_member' instance ..."
+ # is tacked on to the error instead of raising a RuntimeError, so discard it
+ if hasattr(e, '__notes__'):
+ del e.__notes__
+ raise
# update classdict with any changes made by __init_subclass__
classdict.update(enum_class.__dict__)
#