mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-34282: Fix Enum._convert shadowing members named _convert (GH-8568)
* Fix enum members getting shadowed by parent attributes * Move Enum._convert to EnumMeta._convert_ * Deprecate _convert
This commit is contained in:
parent
f52237400b
commit
0fb9fadd3b
7 changed files with 99 additions and 53 deletions
|
@ -70,22 +70,22 @@ __all__.extend(os._get_exports_list(_socket))
|
|||
# in this module understands the enums and translates them back from integers
|
||||
# where needed (e.g. .family property of a socket object).
|
||||
|
||||
IntEnum._convert(
|
||||
IntEnum._convert_(
|
||||
'AddressFamily',
|
||||
__name__,
|
||||
lambda C: C.isupper() and C.startswith('AF_'))
|
||||
|
||||
IntEnum._convert(
|
||||
IntEnum._convert_(
|
||||
'SocketKind',
|
||||
__name__,
|
||||
lambda C: C.isupper() and C.startswith('SOCK_'))
|
||||
|
||||
IntFlag._convert(
|
||||
IntFlag._convert_(
|
||||
'MsgFlag',
|
||||
__name__,
|
||||
lambda C: C.isupper() and C.startswith('MSG_'))
|
||||
|
||||
IntFlag._convert(
|
||||
IntFlag._convert_(
|
||||
'AddressInfo',
|
||||
__name__,
|
||||
lambda C: C.isupper() and C.startswith('AI_'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue