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/selectmodule.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/selectmodule.c.h')
-rw-r--r-- | Modules/clinic/selectmodule.c.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/clinic/selectmodule.c.h b/Modules/clinic/selectmodule.c.h index d7095df..a1695f2 100644 --- a/Modules/clinic/selectmodule.c.h +++ b/Modules/clinic/selectmodule.c.h @@ -933,11 +933,13 @@ select_kqueue(PyTypeObject *type, PyObject *args, PyObject *kwargs) { PyObject *return_value = NULL; - if ((type == _selectstate_by_type(type)->kqueue_queue_Type) && + if ((type == _selectstate_by_type(type)->kqueue_queue_Type || + type->tp_init == _selectstate_by_type(type)->kqueue_queue_Type->tp_init) && !_PyArg_NoPositional("kqueue", args)) { goto exit; } - if ((type == _selectstate_by_type(type)->kqueue_queue_Type) && + if ((type == _selectstate_by_type(type)->kqueue_queue_Type || + type->tp_init == _selectstate_by_type(type)->kqueue_queue_Type->tp_init) && !_PyArg_NoKeywords("kqueue", kwargs)) { goto exit; } @@ -1179,4 +1181,4 @@ exit: #ifndef SELECT_KQUEUE_CONTROL_METHODDEF #define SELECT_KQUEUE_CONTROL_METHODDEF #endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */ -/*[clinic end generated code: output=cd2062a787e13b35 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=ed1e5a658863244c input=a9049054013a1b77]*/ |