[Python-checkins] r42423 - python/trunk/Modules/_heapqmodule.c

thomas.wouters python-checkins at python.org
Thu Feb 16 18:32:55 CET 2006


Author: thomas.wouters
Date: Thu Feb 16 18:32:54 2006
New Revision: 42423

Modified:
   python/trunk/Modules/_heapqmodule.c
Log:

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)



Modified: python/trunk/Modules/_heapqmodule.c
==============================================================================
--- python/trunk/Modules/_heapqmodule.c	(original)
+++ python/trunk/Modules/_heapqmodule.c	Thu Feb 16 18:32:54 2006
@@ -393,7 +393,7 @@
 	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);


More information about the Python-checkins mailing list