mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #17765: weakref.ref() no longer silently ignores keyword arguments.
Patch by Georg Brandl.
This commit is contained in:
commit
17e22959a4
3 changed files with 10 additions and 1 deletions
|
@ -268,7 +268,6 @@ static int
|
|||
parse_weakref_init_args(const char *funcname, PyObject *args, PyObject *kwargs,
|
||||
PyObject **obp, PyObject **callbackp)
|
||||
{
|
||||
/* XXX Should check that kwargs == NULL or is empty. */
|
||||
return PyArg_UnpackTuple(args, funcname, 1, 2, obp, callbackp);
|
||||
}
|
||||
|
||||
|
@ -331,6 +330,9 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
{
|
||||
PyObject *tmp;
|
||||
|
||||
if (!_PyArg_NoKeywords("ref()", kwargs))
|
||||
return -1;
|
||||
|
||||
if (parse_weakref_init_args("__init__", args, kwargs, &tmp, &tmp))
|
||||
return 0;
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue