summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-17 05:00:22 (GMT)
committerGitHub <noreply@github.com>2022-06-17 05:00:22 (GMT)
commit0319052090721a966892ee1384ce1246f09f7020 (patch)
tree0c8432fa89afd0106eeb02bcf90d1a2ba026236c /Lib/enum.py
parent3fbf5c6427c260eab41c37f6eb7f66b79ab4ea88 (diff)
downloadcpython-0319052090721a966892ee1384ce1246f09f7020.zip
cpython-0319052090721a966892ee1384ce1246f09f7020.tar.gz
cpython-0319052090721a966892ee1384ce1246f09f7020.tar.bz2
gh-93847: Fix repr of enum of generic aliases (GH-93885)
(cherry picked from commit 138db8e48b0bb006b1561f8ec76ade97afc6cbd7) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 091acb3..1dc3a0e 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -1240,7 +1240,7 @@ class Enum(metaclass=EnumType):
return None
def __repr__(self):
- v_repr = self.__class__._value_repr_ or self._value_.__class__.__repr__
+ v_repr = self.__class__._value_repr_ or repr
return "<%s.%s: %s>" % (self.__class__.__name__, self._name_, v_repr(self._value_))
def __str__(self):
@@ -1515,7 +1515,7 @@ class Flag(Enum, boundary=STRICT):
def __repr__(self):
cls_name = self.__class__.__name__
- v_repr = self.__class__._value_repr_ or self._value_.__class__.__repr__
+ v_repr = self.__class__._value_repr_ or repr
if self._name_ is None:
return "<%s: %s>" % (cls_name, v_repr(self._value_))
else: