summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-09-14 19:43:36 (GMT)
committerGuido van Rossum <guido@python.org>2001-09-14 19:43:36 (GMT)
commita8c60f478cfadf9d75d605816f3962fbe588640a (patch)
tree4f5c94aff64a700687280e1476f8dbbc160e6e79 /Objects
parentf21c6be7bd41609a4bc11f6a900da01f70be3258 (diff)
downloadcpython-a8c60f478cfadf9d75d605816f3962fbe588640a.zip
cpython-a8c60f478cfadf9d75d605816f3962fbe588640a.tar.gz
cpython-a8c60f478cfadf9d75d605816f3962fbe588640a.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 52fd7e9..2a9ef71 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2303,7 +2303,7 @@ tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds)
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,