summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2022-05-23 17:11:18 (GMT)
committerGitHub <noreply@github.com>2022-05-23 17:11:18 (GMT)
commit96218f774e2b3c5a4ded5f48b22ec97e02043def (patch)
tree8ed7482cd572f67bcaff353e5648f6c417caac3d /Lib/enum.py
parenta509d2674a388a13ca55451480673e2af2ab2875 (diff)
downloadcpython-96218f774e2b3c5a4ded5f48b22ec97e02043def.zip
cpython-96218f774e2b3c5a4ded5f48b22ec97e02043def.tar.gz
cpython-96218f774e2b3c5a4ded5f48b22ec97e02043def.tar.bz2
[3.11] gh-93100: [Enum] fix missing variable in global_str (GH-93107) (GH-93134)
(cherry picked from commit 046df59658c9f64a9f0fc909ed62e92c6c4dd668) Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index b9811fe..43cd1bc 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -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_