[Python-checkins] r52041 - in python/branches/release24-maint: Misc/NEWS Python/bltinmodule.c

andrew.kuchling python-checkins at python.org
Fri Sep 29 19:52:34 CEST 2006


Author: andrew.kuchling
Date: Fri Sep 29 19:52:32 2006
New Revision: 52041

Modified:
   python/branches/release24-maint/Misc/NEWS
   python/branches/release24-maint/Python/bltinmodule.c
Log:
[Backport rev. 41696 by neal.norwitz]

Fix an int/long mismatch identified here:
        http://www.tortall.net/mu/blog/2005/12/01

Pointed out from SF #1365916.

Backport candidate.



Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS	(original)
+++ python/branches/release24-maint/Misc/NEWS	Fri Sep 29 19:52:32 2006
@@ -12,6 +12,8 @@
 Core and builtins
 -----------------
 
+- Bug #1365916: Fix an int/long mismatch in the sorted() built-in.
+
 - Fix memory leak of coding spec in Parser/tokenizer.c.
  
 - Overflow checking code in integer division ran afoul of new gcc

Modified: python/branches/release24-maint/Python/bltinmodule.c
==============================================================================
--- python/branches/release24-maint/Python/bltinmodule.c	(original)
+++ python/branches/release24-maint/Python/bltinmodule.c	Fri Sep 29 19:52:32 2006
@@ -1811,9 +1811,10 @@
 	PyObject *newlist, *v, *seq, *compare=NULL, *keyfunc=NULL, *newargs;
 	PyObject *callable;
 	static char *kwlist[] = {"iterable", "cmp", "key", "reverse", 0};
-	long reverse;
+	int reverse;
 
 	if (args != NULL) {
+	        /* args 1-4 should match listsort in Objects/listobject.c */
 		if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OOi:sorted",
 			kwlist, &seq, &compare, &keyfunc, &reverse))
 			return NULL;


More information about the Python-checkins mailing list