diff options
Diffstat (limited to 'Lib/enum.py')
-rw-r--r-- | Lib/enum.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/enum.py b/Lib/enum.py index 403f747d22..69a7f49d80 100644 --- a/Lib/enum.py +++ b/Lib/enum.py @@ -622,8 +622,9 @@ class Enum(metaclass=EnumMeta): # we can get strange results with the Enum name showing up instead of # the value - # pure Enum branch - if self._member_type_ is object: + # pure Enum branch, or branch with __str__ explicitly overridden + str_overridden = type(self).__str__ != Enum.__str__ + if self._member_type_ is object or str_overridden: cls = str val = str(self) # mix-in branch |