summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-07 12:41:09 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-07 12:41:09 (GMT)
commit21eb48764c618eede0405ef840eadf1b03ff9b00 (patch)
tree74014667fe8b77408970089321c055ac10369fa9 /Objects
parent6dff0205b724669cc0469dd65a3f7edc5a69e1e7 (diff)
downloadcpython-21eb48764c618eede0405ef840eadf1b03ff9b00.zip
cpython-21eb48764c618eede0405ef840eadf1b03ff9b00.tar.gz
cpython-21eb48764c618eede0405ef840eadf1b03ff9b00.tar.bz2
Issue #17765: weakref.ref() no longer silently ignores keyword arguments.
Patch by Georg Brandl.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/weakrefobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index d4d52e6..7e6f364 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -268,7 +268,6 @@ static int
parse_weakref_init_args(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