diff Objects/typeobject.c @ 34682:903045a70c3e 2.4

Convert "__init__ should return None" from an exception to a warning.
author Raymond Hettinger <python@rcn.com>
date Fri, 04 Mar 2005 04:47:04 +0000
parents 9b3a2c4302aa
children 78d0a558b093
line wrap: on
line diff
--- a/Objects/typeobject.c	Thu Mar 03 23:15:04 2005 +0000
+++ b/Objects/typeobject.c	Fri Mar 04 04:47:04 2005 +0000
@@ -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;