summaryrefslogtreecommitdiffstats
path: root/Lib/enum.py
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2024-03-11 20:42:01 (GMT)
committerGitHub <noreply@github.com>2024-03-11 20:42:01 (GMT)
commit3c0dcef9808e34744096769b15bad4f1f97569f0 (patch)
tree6aeaef336882e0b64f28bace1701f9c27a39866c /Lib/enum.py
parent34920f36917de0d4e658cf94992d53a5a7f27f51 (diff)
downloadcpython-3c0dcef9808e34744096769b15bad4f1f97569f0.zip
cpython-3c0dcef9808e34744096769b15bad4f1f97569f0.tar.gz
cpython-3c0dcef9808e34744096769b15bad4f1f97569f0.tar.bz2
gh-116040: [Enum] fix test_empty_names test (GH-116508)
* and fix _not_given usage
Diffstat (limited to 'Lib/enum.py')
-rw-r--r--Lib/enum.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/enum.py b/Lib/enum.py
index 3499cb0..bcf7aae 100644
--- a/Lib/enum.py
+++ b/Lib/enum.py
@@ -165,8 +165,6 @@ def _dedent(text):
class _not_given:
def __repr__(self):
return('<not given>')
- def __bool__(self):
- return False
_not_given = _not_given()
class _auto_null:
@@ -727,7 +725,7 @@ class EnumType(type):
)
return cls._create_(
class_name=value,
- names=names or None,
+ names=None if names is _not_given else names,
module=module,
qualname=qualname,
type=type,