diff options
author | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:05:26 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2025-06-13 00:35:30 +0300 |
commit | 796b9088366b10b4cd42885101fc20c0b5709b07 (patch) | |
tree | f287eacb0b95ffd7cabf95b16cafb4788645dc38 /contrib/tools/python3/Lib/enum.py | |
parent | c72bca862651e507d2ff4980ef7f4ff7267a7227 (diff) | |
download | ydb-796b9088366b10b4cd42885101fc20c0b5709b07.tar.gz |
Update Python 3 to 3.12.10
commit_hash:dd2398e159fe1d72ea6b12da52fccc933a41a785
Diffstat (limited to 'contrib/tools/python3/Lib/enum.py')
-rw-r--r-- | contrib/tools/python3/Lib/enum.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/tools/python3/Lib/enum.py b/contrib/tools/python3/Lib/enum.py index eaa517e2fbc..c87aeef7157 100644 --- a/contrib/tools/python3/Lib/enum.py +++ b/contrib/tools/python3/Lib/enum.py @@ -771,10 +771,15 @@ class EnumType(type): `value` is in `cls` if: 1) `value` is a member of `cls`, or 2) `value` is the value of one of the `cls`'s members. + 3) `value` is a pseudo-member (flags) """ if isinstance(value, cls): return True - return value in cls._value2member_map_ or value in cls._unhashable_values_ + try: + cls(value) + return True + except ValueError: + return value in cls._unhashable_values_ def __delattr__(cls, attr): # nicer error message when someone tries to delete an attribute |