summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
authorArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 12:28:58 (GMT)
committerArmin Ronacher <armin.ronacher@active-4.com>2012-10-06 12:28:58 (GMT)
commit226b1db0e2b3eccb8821f60f9a75c8abfc62b78a (patch)
tree424e65249d3538ce2d0a3233c9132095d2dc0aaf /Objects/object.c
parentdfc23974ed149ae81d75e7719aee67648b48e217 (diff)
downloadcpython-226b1db0e2b3eccb8821f60f9a75c8abfc62b78a.zip
cpython-226b1db0e2b3eccb8821f60f9a75c8abfc62b78a.tar.gz
cpython-226b1db0e2b3eccb8821f60f9a75c8abfc62b78a.tar.bz2
Added notimplemented_dealloc for better error reporting
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index f417184..858eebe 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -1524,12 +1524,21 @@ notimplemented_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
Py_RETURN_NOTIMPLEMENTED;
}
+static void
+notimplemented_dealloc(PyObject* ignore)
+{
+ /* This should never get called, but we also don't want to SEGV if
+ * we accidentally decref NotImplemented out of existence.
+ */
+ Py_FatalError("deallocating NotImplemented");
+}
+
static PyTypeObject PyNotImplemented_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"NotImplementedType",
0,
0,
- none_dealloc, /*tp_dealloc*/ /*never called*/
+ notimplemented_dealloc, /*tp_dealloc*/ /*never called*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/