diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2021-09-12 10:27:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-12 10:27:50 (GMT) |
commit | 92bf8691fb78f3484bf2daba836c416efedb1d8d (patch) | |
tree | f5e605dbb607ec58daa687300a5f59f99dd1aee4 /Modules/clinic/_ssl.c.h | |
parent | 5277ffe12d492939544ff9c54a3aaf448b913fb3 (diff) | |
download | cpython-92bf8691fb78f3484bf2daba836c416efedb1d8d.zip cpython-92bf8691fb78f3484bf2daba836c416efedb1d8d.tar.gz cpython-92bf8691fb78f3484bf2daba836c416efedb1d8d.tar.bz2 |
bpo-43413: Fix handling keyword arguments in subclasses of some buitin classes (GH-26456)
* Constructors of subclasses of some buitin classes (e.g. tuple, list,
frozenset) no longer accept arbitrary keyword arguments.
* Subclass of set can now define a __new__() method with additional
keyword parameters without overriding also __init__().
Diffstat (limited to 'Modules/clinic/_ssl.c.h')
-rw-r--r-- | Modules/clinic/_ssl.c.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/clinic/_ssl.c.h b/Modules/clinic/_ssl.c.h index b59b129..67eaf3f 100644 --- a/Modules/clinic/_ssl.c.h +++ b/Modules/clinic/_ssl.c.h @@ -408,7 +408,8 @@ _ssl__SSLContext(PyTypeObject *type, PyObject *args, PyObject *kwargs) PyObject *return_value = NULL; int proto_version; - if ((type == get_state_type(type)->PySSLContext_Type) && + if ((type == get_state_type(type)->PySSLContext_Type || + type->tp_init == get_state_type(type)->PySSLContext_Type->tp_init) && !_PyArg_NoKeywords("_SSLContext", kwargs)) { goto exit; } @@ -884,11 +885,13 @@ _ssl_MemoryBIO(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - if ((type == get_state_type(type)->PySSLMemoryBIO_Type) && + if ((type == get_state_type(type)->PySSLMemoryBIO_Type || + type->tp_init == get_state_type(type)->PySSLMemoryBIO_Type->tp_init) && !_PyArg_NoPositional("MemoryBIO", args)) { goto exit; } - if ((type == get_state_type(type)->PySSLMemoryBIO_Type) && + if ((type == get_state_type(type)->PySSLMemoryBIO_Type || + type->tp_init == get_state_type(type)->PySSLMemoryBIO_Type->tp_init) && !_PyArg_NoKeywords("MemoryBIO", kwargs)) { goto exit; } @@ -1358,4 +1361,4 @@ exit: #ifndef _SSL_ENUM_CRLS_METHODDEF #define _SSL_ENUM_CRLS_METHODDEF #endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */ -/*[clinic end generated code: output=5a7d7bf5cf8ee092 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cd2a53c26eda295e input=a9049054013a1b77]*/ |