mirror of
https://github.com/python/cpython.git
synced 2025-11-26 13:22:51 +00:00
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
This commit is contained in:
parent
1adbb50701
commit
e1fdb32ff2
6 changed files with 52 additions and 41 deletions
|
|
@ -3260,6 +3260,8 @@ PyType_Ready(PyTypeObject *type)
|
|||
if (PyDict_GetItemString(type->tp_dict, "__doc__") == NULL) {
|
||||
if (type->tp_doc != NULL) {
|
||||
PyObject *doc = PyString_FromString(type->tp_doc);
|
||||
if (doc == NULL)
|
||||
goto error;
|
||||
PyDict_SetItemString(type->tp_dict, "__doc__", doc);
|
||||
Py_DECREF(doc);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue