summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2020-12-08 19:14:10 (GMT)
committerGitHub <noreply@github.com>2020-12-08 19:14:10 (GMT)
commit37440eef7f9a0c27e13fc9ce0850574bb00688b0 (patch)
treeb96c61bc2d39bef6d78dc3c9506ad69304051a9f /Lib/enum.py
parentc168b5078f88874b9acd993ac886f82269c780dd (diff)
downloadcpython-37440eef7f9a0c27e13fc9ce0850574bb00688b0.zip
cpython-37440eef7f9a0c27e13fc9ce0850574bb00688b0.tar.gz
cpython-37440eef7f9a0c27e13fc9ce0850574bb00688b0.tar.bz2
bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497)
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index d670ad7..484db2c 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -658,7 +658,7 @@ class Enum(metaclass=EnumMeta):
# the value
# pure Enum branch, or branch with __str__ explicitly overridden
- str_overridden = type(self).__str__ != Enum.__str__
+ str_overridden = type(self).__str__ not in (Enum.__str__, Flag.__str__)
if self._member_type_ is object or str_overridden:
cls = str
val = str(self)