diff Objects/typeobject.c @ 19914:2027dc124edd legacy-trunk

tp_new_wrapper(): A subtle change in the check for safe use. Allow staticbase != type, as long as their tp_new slots are the same.
author Guido van Rossum <guido@python.org>
date Fri, 14 Sep 2001 19:43:36 +0000
parents ca0f54dacdd8
children 76133a465e03
line wrap: on
line diff
--- a/Objects/typeobject.c	Fri Sep 14 17:51:50 2001 +0000
+++ b/Objects/typeobject.c	Fri Sep 14 19:43:36 2001 +0000
@@ -2303,7 +2303,7 @@
 	staticbase = subtype;
 	while (staticbase && (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
 		staticbase = staticbase->tp_base;
-	if (staticbase != type) {
+	if (staticbase->tp_new != type->tp_new) {
 		PyErr_Format(PyExc_TypeError,
 			     "%s.__new__(%s) is not safe, use %s.__new__()",
 			     type->tp_name,