summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-12-08 19:52:58 (GMT)
committerGitHub <noreply@github.com>2020-12-08 19:52:58 (GMT)
commitcbfcc67170d459bcf3e9d63d2f44eadec740bf69 (patch)
treeadade1990f5a32741e8f203f77b18306b7bee348 /Lib/enum.py
parentb947b305a6833cc059214d5bdd2065edd65024c4 (diff)
downloadcpython-cbfcc67170d459bcf3e9d63d2f44eadec740bf69.zip
cpython-cbfcc67170d459bcf3e9d63d2f44eadec740bf69.tar.gz
cpython-cbfcc67170d459bcf3e9d63d2f44eadec740bf69.tar.bz2
bpo-41907: [Enum] fix format() behavior for IntFlag (GH-22497) (GH-23704)
(cherry picked from commit 37440eef7f9a0c27e13fc9ce0850574bb00688b0)
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 da809e2..da0657f 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -663,7 +663,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)