diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-07-21 05:32:28 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-07-21 05:32:28 +0000 |
commit | e1fdb32ff2bb1f4b46b56fc1de03f8016bc6c780 (patch) | |
tree | cd676947643217e1aaaa4723beecc6313d9d15b6 /Python/pystate.c | |
parent | 1adbb507013bea05cda92ea6aa9a8fef72657923 (diff) | |
download | cpython-git-e1fdb32ff2bb1f4b46b56fc1de03f8016bc6c780.tar.gz |
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index eca26c78c8..3fae85be88 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -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; |