mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +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
|
@ -63,6 +63,10 @@ PyInterpreterState_New(void)
|
|||
|
||||
if (interp != NULL) {
|
||||
HEAD_INIT();
|
||||
#ifdef WITH_THREAD
|
||||
if (head_mutex == NULL)
|
||||
Py_FatalError("Can't initialize threads for interpreter");
|
||||
#endif
|
||||
interp->modules = NULL;
|
||||
interp->sysdict = NULL;
|
||||
interp->builtins = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue