diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-09 16:09:03 +0100 |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2017-02-09 16:09:03 +0100 |
commit | 2a1d833d5da7fa7a01a2eef183b0a208ed019427 (patch) | |
tree | 8da3ebb695ae55c69d0a58691403fb13d96a9476 /Modules/_functoolsmodule.c | |
parent | c6180bb73c8c7c7f9d8ea9816487b710597b6fc1 (diff) | |
parent | bbd3587a29510bd5a318e0a19fc8570c0cd3b622 (diff) | |
download | cpython-2a1d833d5da7fa7a01a2eef183b0a208ed019427.tar.gz |
Merge issue #26355 fix from 3.6
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r-- | Modules/_functoolsmodule.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index f785a7260e..4170883368 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -84,7 +84,7 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw) } Py_DECREF(nargs); - if (pkw == NULL || PyDict_Size(pkw) == 0) { + if (pkw == NULL || PyDict_GET_SIZE(pkw) == 0) { if (kw == NULL) { pto->kw = PyDict_New(); } @@ -155,7 +155,7 @@ partial_call(partialobject *pto, PyObject *args, PyObject *kw) assert(PyTuple_Check(argappl)); } - if (PyDict_Size(pto->kw) == 0) { + if (PyDict_GET_SIZE(pto->kw) == 0) { kwappl = kw; Py_XINCREF(kwappl); } @@ -713,7 +713,7 @@ lru_cache_make_key(PyObject *args, PyObject *kwds, int typed) return args; } - kwds_size = kwds ? PyDict_Size(kwds) : 0; + kwds_size = kwds ? PyDict_GET_SIZE(kwds) : 0; assert(kwds_size >= 0); key_size = PyTuple_GET_SIZE(args); @@ -934,7 +934,7 @@ bounded_lru_cache_wrapper(lru_cache_object *self, PyObject *args, PyObject *kwds } lru_cache_append_link(self, link); Py_INCREF(result); /* for return */ - self->full = (PyDict_Size(self->cache) >= self->maxsize); + self->full = (PyDict_GET_SIZE(self->cache) >= self->maxsize); } self->misses++; return result; @@ -1063,7 +1063,7 @@ lru_cache_cache_info(lru_cache_object *self, PyObject *unused) { return PyObject_CallFunction(self->cache_info_type, "nnOn", self->hits, self->misses, self->maxsize_O, - PyDict_Size(self->cache)); + PyDict_GET_SIZE(self->cache)); } static PyObject * @@ -1247,7 +1247,7 @@ PyInit__functools(void) if (m == NULL) return NULL; - kwd_mark = PyObject_CallObject((PyObject *)&PyBaseObject_Type, NULL); + kwd_mark = _PyObject_CallNoArg((PyObject *)&PyBaseObject_Type); if (!kwd_mark) { Py_DECREF(m); return NULL; |