[Python-checkins] r58329 - python/trunk/Modules/_collectionsmodule.c

neal.norwitz python-checkins at python.org
Fri Oct 5 05:39:18 CEST 2007


Author: neal.norwitz
Date: Fri Oct  5 05:39:17 2007
New Revision: 58329

Modified:
   python/trunk/Modules/_collectionsmodule.c
Log:
dict could be NULL, so we need to XDECREF.
Fix a compiler warning about passing a PyTypeObject* instead of PyObject*.


Modified: python/trunk/Modules/_collectionsmodule.c
==============================================================================
--- python/trunk/Modules/_collectionsmodule.c	(original)
+++ python/trunk/Modules/_collectionsmodule.c	Fri Oct  5 05:39:17 2007
@@ -614,7 +614,7 @@
 		PyErr_Clear();
 	aslist = PySequence_List((PyObject *)deque);
 	if (aslist == NULL) {
-		Py_DECREF(dict);
+		Py_XDECREF(dict);
 		return NULL;
 	}
 	if (dict == NULL)
@@ -1143,7 +1143,7 @@
 	   whose class constructor has the same signature.  Subclasses that
 	   define a different constructor signature must override copy().
 	*/
-	return PyObject_CallFunctionObjArgs(Py_Type(dd),
+	return PyObject_CallFunctionObjArgs((PyObject*)Py_Type(dd),
 					    dd->default_factory, dd, NULL);
 }
 


More information about the Python-checkins mailing list