summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-12-16 14:18:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-12-16 14:18:57 (GMT)
commit5ab81d787f455ba28367b5b71606cea376283574 (patch)
treee78623a175940cb3d25d950812d0079021b178b7 /Python/getargs.c
parent1d59a0aacf1ddd000b6c6e231cf82ddf74afe3b4 (diff)
downloadcpython-5ab81d787f455ba28367b5b71606cea376283574.zip
cpython-5ab81d787f455ba28367b5b71606cea376283574.tar.gz
cpython-5ab81d787f455ba28367b5b71606cea376283574.tar.bz2
Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of dict.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index c552d0f..49888d1 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -1650,7 +1650,7 @@ vgetargskeywords(PyObject *args, PyObject *keywords, const char *format,
}
nargs = PyTuple_GET_SIZE(args);
- nkeywords = (keywords == NULL) ? 0 : PyDict_Size(keywords);
+ nkeywords = (keywords == NULL) ? 0 : PyDict_GET_SIZE(keywords);
if (nargs + nkeywords > len) {
PyErr_Format(PyExc_TypeError,
"%s%s takes at most %d argument%s (%zd given)",
@@ -2034,7 +2034,7 @@ vgetargskeywordsfast_impl(PyObject **args, Py_ssize_t nargs,
}
if (keywords != NULL) {
- nkeywords = PyDict_Size(keywords);
+ nkeywords = PyDict_GET_SIZE(keywords);
}
else if (kwnames != NULL) {
nkeywords = PyTuple_GET_SIZE(kwnames);
@@ -2421,7 +2421,7 @@ _PyArg_NoKeywords(const char *funcname, PyObject *kw)
PyErr_BadInternalCall();
return 0;
}
- if (PyDict_Size(kw) == 0)
+ if (PyDict_GET_SIZE(kw) == 0)
return 1;
PyErr_Format(PyExc_TypeError, "%s does not take keyword arguments",