diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-16 14:18:57 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-12-16 14:18:57 (GMT) |
commit | 5ab81d787f455ba28367b5b71606cea376283574 (patch) | |
tree | e78623a175940cb3d25d950812d0079021b178b7 /Modules/itertoolsmodule.c | |
parent | 1d59a0aacf1ddd000b6c6e231cf82ddf74afe3b4 (diff) | |
download | cpython-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 'Modules/itertoolsmodule.c')
-rw-r--r-- | Modules/itertoolsmodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/itertoolsmodule.c b/Modules/itertoolsmodule.c index 6bf04cb..7cbee2b 100644 --- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -4180,7 +4180,7 @@ repeat_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; if (kwds != NULL) - n_kwds = PyDict_Size(kwds); + n_kwds = PyDict_GET_SIZE(kwds); /* Does user supply times argument? */ if ((PyTuple_Size(args) + n_kwds == 2) && cnt < 0) cnt = 0; @@ -4331,9 +4331,9 @@ zip_longest_new(PyTypeObject *type, PyObject *args, PyObject *kwds) PyObject *fillvalue = Py_None; Py_ssize_t tuplesize = PySequence_Length(args); - if (kwds != NULL && PyDict_CheckExact(kwds) && PyDict_Size(kwds) > 0) { + if (kwds != NULL && PyDict_CheckExact(kwds) && PyDict_GET_SIZE(kwds) > 0) { fillvalue = PyDict_GetItemString(kwds, "fillvalue"); - if (fillvalue == NULL || PyDict_Size(kwds) > 1) { + if (fillvalue == NULL || PyDict_GET_SIZE(kwds) > 1) { PyErr_SetString(PyExc_TypeError, "zip_longest() got an unexpected keyword argument"); return NULL; |