summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-03-12 00:36:00 (GMT)
committerGitHub <noreply@github.com>2024-03-12 00:36:00 (GMT)
commit1fb661579dadce6550925ad17a40eba2dec91d45 (patch)
tree0bfe14edfc6a21cd5593a57a8f1face7f190531f /Lib/enum.py
parent8b3b5be934622670dc1670ab60b70c668004bb62 (diff)
downloadcpython-1fb661579dadce6550925ad17a40eba2dec91d45.zip
cpython-1fb661579dadce6550925ad17a40eba2dec91d45.tar.gz
cpython-1fb661579dadce6550925ad17a40eba2dec91d45.tar.bz2
[3.12] gh-116600: [Enum] fix global Flag repr (GH-116615) (GH-116629)
* and fix global flag repr (cherry picked from commit 06e29a224fac9edeba55422d2e60f2fbb88dddce) Co-authored-by: Ethan Furman <ethan@stoneleaf.us> Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 50eca3f..af56138 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1651,7 +1651,7 @@ def global_flag_repr(self):
cls_name = self.__class__.__name__
if self._name_ is None:
return "%s.%s(%r)" % (module, cls_name, self._value_)
- if _is_single_bit(self):
+ if _is_single_bit(self._value_):
return '%s.%s' % (module, self._name_)
if self._boundary_ is not FlagBoundary.KEEP:
return '|'.join(['%s.%s' % (module, name) for name in self.name.split('|')])