[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:
Ethan Furman 2022-05-23 10:11:18 -07:00 committed by GitHub
parent a509d2674a
commit 96218f774e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -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_