mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +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
12
Lib/ssl.py
12
Lib/ssl.py
|
@ -119,32 +119,32 @@ from _ssl import (
|
|||
from _ssl import _DEFAULT_CIPHERS, _OPENSSL_API_VERSION
|
||||
|
||||
|
||||
_IntEnum._convert(
|
||||
_IntEnum._convert_(
|
||||
'_SSLMethod', __name__,
|
||||
lambda name: name.startswith('PROTOCOL_') and name != 'PROTOCOL_SSLv23',
|
||||
source=_ssl)
|
||||
|
||||
_IntFlag._convert(
|
||||
_IntFlag._convert_(
|
||||
'Options', __name__,
|
||||
lambda name: name.startswith('OP_'),
|
||||
source=_ssl)
|
||||
|
||||
_IntEnum._convert(
|
||||
_IntEnum._convert_(
|
||||
'AlertDescription', __name__,
|
||||
lambda name: name.startswith('ALERT_DESCRIPTION_'),
|
||||
source=_ssl)
|
||||
|
||||
_IntEnum._convert(
|
||||
_IntEnum._convert_(
|
||||
'SSLErrorNumber', __name__,
|
||||
lambda name: name.startswith('SSL_ERROR_'),
|
||||
source=_ssl)
|
||||
|
||||
_IntFlag._convert(
|
||||
_IntFlag._convert_(
|
||||
'VerifyFlags', __name__,
|
||||
lambda name: name.startswith('VERIFY_'),
|
||||
source=_ssl)
|
||||
|
||||
_IntEnum._convert(
|
||||
_IntEnum._convert_(
|
||||
'VerifyMode', __name__,
|
||||
lambda name: name.startswith('CERT_'),
|
||||
source=_ssl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue