[Python-checkins] r45598 - python/trunk/Objects/typeobject.c

thomas.wouters python-checkins at python.org
Fri Apr 21 13:26:57 CEST 2006


Author: thomas.wouters
Date: Fri Apr 21 13:26:56 2006
New Revision: 45598

Modified:
   python/trunk/Objects/typeobject.c
Log:

Fix variable/format-char discrepancy in new-style class __getitem__,
__delitem__, __setslice__ and __delslice__ hooks. This caused test_weakref
and test_userlist to fail in the p3yk branch (where UserList, like all
classes, is new-style) on amd64 systems, with open-ended slices: the
sys.maxint value for empty-endpoint was transformed into -1.



Modified: python/trunk/Objects/typeobject.c
==============================================================================
--- python/trunk/Objects/typeobject.c	(original)
+++ python/trunk/Objects/typeobject.c	Fri Apr 21 13:26:56 2006
@@ -4186,10 +4186,10 @@
 
 	if (value == NULL)
 		res = call_method(self, "__delitem__", &delitem_str,
-				  "(i)", index);
+				  "(n)", index);
 	else
 		res = call_method(self, "__setitem__", &setitem_str,
-				  "(iO)", index, value);
+				  "(nO)", index, value);
 	if (res == NULL)
 		return -1;
 	Py_DECREF(res);
@@ -4204,10 +4204,10 @@
 
 	if (value == NULL)
 		res = call_method(self, "__delslice__", &delslice_str,
-				  "(ii)", i, j);
+				  "(nn)", i, j);
 	else
 		res = call_method(self, "__setslice__", &setslice_str,
-				  "(iiO)", i, j, value);
+				  "(nnO)", i, j, value);
 	if (res == NULL)
 		return -1;
 	Py_DECREF(res);


More information about the Python-checkins mailing list