mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
[3.11] gh-93100: [Enum] fix missing variable in global_str (GH-93107) (GH-93134)
(cherry picked from commit 046df59658
)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
This commit is contained in:
parent
a509d2674a
commit
96218f774e
2 changed files with 12 additions and 0 deletions
|
@ -1643,6 +1643,7 @@ def global_str(self):
|
|||
use enum_name instead of class.enum_name
|
||||
"""
|
||||
if self._name_ is None:
|
||||
cls_name = self.__class__.__name__
|
||||
return "%s(%r)" % (cls_name, self._value_)
|
||||
else:
|
||||
return self._name_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue