diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 14:06:54 +0200 |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2012-11-18 14:06:54 +0200 |
| commit | 23e41c9686435a8a01da7fead079c783087ee5c5 (patch) | |
| tree | 0593cf00b74bcabb8cb52c2108750c2f80fa2c81 /Objects/object.c | |
| parent | 68a2b84e68c3fe3abaa1bae589e17bfbb13461c2 (diff) | |
| parent | e93555d91c4608e06e3058a42af0f2450c9dfd19 (diff) | |
| download | cpython-23e41c9686435a8a01da7fead079c783087ee5c5.tar.gz | |
#16306: merge with 3.3.
Diffstat (limited to 'Objects/object.c')
| -rw-r--r-- | Objects/object.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Objects/object.c b/Objects/object.c index 949e7dc7f3..fd1fd256ba 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*/ @@ -1699,15 +1708,6 @@ _Py_ReadyTypes(void) if (PyType_Ready(&PyMemberDescr_Type) < 0) Py_FatalError("Can't initialize member descriptor type"); - if (PyType_Ready(&PyFilter_Type) < 0) - Py_FatalError("Can't initialize filter type"); - - if (PyType_Ready(&PyMap_Type) < 0) - Py_FatalError("Can't initialize map type"); - - if (PyType_Ready(&PyZip_Type) < 0) - Py_FatalError("Can't initialize zip type"); - if (PyType_Ready(&_PyNamespace_Type) < 0) Py_FatalError("Can't initialize namespace type"); |
