Skip to content

Commit 4d99b33

Browse files
authored
Fix an unnecessary allowlist entry in ssl.pyi (#9776)
1 parent 9163c71 commit 4d99b33

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

stdlib/ssl.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,14 @@ ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: AlertDescription
291291
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: AlertDescription
292292
ALERT_DESCRIPTION_USER_CANCELLED: AlertDescription
293293

294-
class _ASN1Object(NamedTuple):
294+
class _ASN1ObjectBase(NamedTuple):
295295
nid: int
296296
shortname: str
297297
longname: str
298298
oid: str
299+
300+
class _ASN1Object(_ASN1ObjectBase):
301+
def __new__(cls, oid: str) -> Self: ...
299302
@classmethod
300303
def fromnid(cls, nid: int) -> Self: ...
301304
@classmethod

tests/stubtest_allowlists/py3_common.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ shutil.rmtree # stubtest doesn't like that we have this as an instance of a cal
168168
socketserver.BaseServer.fileno # implemented in derived classes
169169
socketserver.BaseServer.get_request # implemented in derived classes
170170
socketserver.BaseServer.server_bind # implemented in derived classes
171-
ssl.Purpose.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
172-
ssl._ASN1Object.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple.
171+
ssl.Purpose.__new__ # the multiple inheritance confuses mypy
173172
(sys.get_int_max_str_digits)? # Added in a patch release, backported to all security branches, but has yet to find its way to all GitHub Actions images
174173
sys.implementation # Actually SimpleNamespace but then you wouldn't have convenient attributes
175174
(sys.set_int_max_str_digits)? # Added in a patch release, backported to all security branches, but has yet to find its way to all GitHub Actions images

0 commit comments

Comments
 (0)