summaryrefslogtreecommitdiffstats
path: root/Objects/weakrefobject.c
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)
commit816a5ff3b218ac374f89bf3cda0d13f47b7bd92e (patch)
tree4c97c70fda3f69c42196da80fd7dcea299c65e0b /Objects/weakrefobject.c
parentb4905efe23c3e158a3c494d40988ce6de6bde3cd (diff)
downloadcpython-816a5ff3b218ac374f89bf3cda0d13f47b7bd92e.zip
cpython-816a5ff3b218ac374f89bf3cda0d13f47b7bd92e.tar.gz
cpython-816a5ff3b218ac374f89bf3cda0d13f47b7bd92e.tar.bz2
Issue #17765: weakref.ref() no longer silently ignores keyword arguments.
Patch by Georg Brandl.
Diffstat (limited to 'Objects/weakrefobject.c')
-rw-r--r--Objects/weakrefobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c
index e1f4bc4..c8b982f 100644
--- a/Objects/weakrefobject.c
+++ b/Objects/weakrefobject.c
@@ -271,7 +271,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);
}
@@ -334,6 +333,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