diff options
author | Thomas Wouters <thomas@python.org> | 2006-02-16 17:32:54 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2006-02-16 17:32:54 (GMT) |
commit | ed6254acf289839467a77419566b475f5950f475 (patch) | |
tree | 347536c6dceab93f1c4af3904c29b713828ac0a5 /Modules | |
parent | 7a2f83b706b3b8ba4aa62b0e125fb604c7f6b48e (diff) | |
download | cpython-ed6254acf289839467a77419566b475f5950f475.zip cpython-ed6254acf289839467a77419566b475f5950f475.tar.gz cpython-ed6254acf289839467a77419566b475f5950f475.tar.bz2 |
Use 'n' format for Py_ssize_t variables to PyArg_ParseTuple(). Py_ssize_t
has been applied fairly arbitrarily in this module (nsmallest uses
Py_ssize_t, nlargest does not) and it probably deserves a more complete
review. Fixes heapq.nsmallest() always returning the empty list (on
platforms with 64-bit ssize_t/long)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_heapqmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c index fb63c6b..3642769 100644 --- a/Modules/_heapqmodule.c +++ b/Modules/_heapqmodule.c @@ -393,7 +393,7 @@ nsmallest(PyObject *self, PyObject *args) PyObject *heap=NULL, *elem, *iterable, *los, *it, *oldelem; Py_ssize_t i, n; - if (!PyArg_ParseTuple(args, "iO:nsmallest", &n, &iterable)) + if (!PyArg_ParseTuple(args, "nO:nsmallest", &n, &iterable)) return NULL; it = PyObject_GetIter(iterable); |