changeset: 95119:57a457ea84e4 branch: 3.4 parent: 95109:e8878579eb68 user: Serhiy Storchaka date: Sun Mar 22 09:46:36 2015 +0200 files: Objects/typeobject.c description: Issue #22079: Deprecation warning now is issued in PyType_Ready() instead of raising TypeError when statically allocated type subclasses dynamically allocated type diff -r e8878579eb68 -r 57a457ea84e4 Objects/typeobject.c --- a/Objects/typeobject.c Sat Mar 21 09:40:26 2015 +0200 +++ b/Objects/typeobject.c Sun Mar 22 09:46:36 2015 +0200 @@ -4803,11 +4803,14 @@ PyObject *b = PyTuple_GET_ITEM(bases, i); if (PyType_Check(b) && (((PyTypeObject *)b)->tp_flags & Py_TPFLAGS_HEAPTYPE)) { - PyErr_Format(PyExc_TypeError, - "type '%.100s' is not dynamically allocated but " - "its base type '%.100s' is dynamically allocated", - type->tp_name, ((PyTypeObject *)b)->tp_name); - goto error; + char buf[300]; + PyOS_snprintf(buf, sizeof(buf), + "type '%.100s' is not dynamically allocated but " + "its base type '%.100s' is dynamically allocated", + type->tp_name, ((PyTypeObject *)b)->tp_name); + if (PyErr_Warn(PyExc_DeprecationWarning, buf) < 0) + goto error; + break; } }