mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-116600: [Enum] fix global Flag repr (GH-116615) (#116630)
* and fix global flag repr
(cherry picked from commit 06e29a224f
)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
parent
830fbe9b6e
commit
5562a09821
3 changed files with 4 additions and 1 deletions
|
@ -1611,7 +1611,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('|')])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue