[Python-checkins] python/dist/src/Objects typeobject.c, 2.264.2.1, 2.264.2.2

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Fri Mar 4 05:47:06 CET 2005


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6375/Objects

Modified Files:
      Tag: release24-maint
	typeobject.c 
Log Message:
Convert "__init__ should return None" from an exception to a warning.



Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.264.2.1
retrieving revision 2.264.2.2
diff -u -d -r2.264.2.1 -r2.264.2.2
--- typeobject.c	3 Mar 2005 16:55:48 -0000	2.264.2.1
+++ typeobject.c	4 Mar 2005 04:47:03 -0000	2.264.2.2
@@ -4754,10 +4754,11 @@
 	if (res == NULL)
 		return -1;
 	if (res != Py_None) {
-		PyErr_SetString(PyExc_TypeError,
-			   "__init__() should return None");
-		Py_DECREF(res);
-		return -1;
+		if (PyErr_Warn(PyExc_RuntimeWarning, 
+			"__init__() should return None") == -1) {
+			Py_DECREF(res);
+			return -1;
+		}
 	}
 	Py_DECREF(res);
 	return 0;



More information about the Python-checkins mailing list