[3.12] gh-116040: [Enum] fix test_empty_names test (GH-116508) (GH-116619)

* and fix _not_given usage

(cherry picked from commit 3c0dcef980)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
This commit is contained in:
Miss Islington (bot) 2024-03-11 23:16:22 +01:00 committed by GitHub
parent 1231697697
commit 8b3b5be934
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 14 deletions

View file

@ -169,8 +169,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:
@ -765,7 +763,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,