From 5ab81d787f455ba28367b5b71606cea376283574 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 16 Dec 2016 16:18:57 +0200 Subject: Issue #28959: Added private macro PyDict_GET_SIZE for retrieving the size of dict. --- Python/getargs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Python/getargs.c') diff --git a/Python/getargs.c b/Python/getargs.c index c552d0fe27..49888d11b6 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", -- cgit v1.2.1