[Python-checkins] r77954 - in python/branches/release26-maint: Modules/_testcapimodule.c

collin.winter python-checkins at python.org
Wed Feb 3 21:29:11 CET 2010


Author: collin.winter
Date: Wed Feb  3 21:29:10 2010
New Revision: 77954

Log:
Merged revisions 72357,72367 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72357 | benjamin.peterson | 2009-05-05 14:09:21 -0700 (Tue, 05 May 2009) | 4 lines
  
  fix running test_capi with -R ::
  
  Also, fix a refleak in the test that was preventing running. :)
........
  r72367 | benjamin.peterson | 2009-05-05 16:00:48 -0700 (Tue, 05 May 2009) | 1 line
  
  tabify :(
........


Modified:
   python/branches/release26-maint/   (props changed)
   python/branches/release26-maint/Modules/_testcapimodule.c

Modified: python/branches/release26-maint/Modules/_testcapimodule.c
==============================================================================
--- python/branches/release26-maint/Modules/_testcapimodule.c	(original)
+++ python/branches/release26-maint/Modules/_testcapimodule.c	Wed Feb  3 21:29:10 2010
@@ -226,6 +226,13 @@
 	long hash;
 
 	type = &_HashInheritanceTester_Type;
+
+	if (type->tp_dict != NULL)
+		/* The type has already been initialized. This probably means
+		   -R is being used. */
+		Py_RETURN_NONE;
+
+
 	obj = PyObject_New(PyObject, type);
 	if (obj == NULL) {
 		PyErr_Clear();
@@ -269,6 +276,8 @@
 		return NULL;
 	}
 
+	Py_DECREF(obj);
+
 	Py_RETURN_NONE;
 }
 


More information about the Python-checkins mailing list