commit | e1fdb32ff2bb1f4b46b56fc1de03f8016bc6c780 | [log] [tgz] |
---|---|---|
author | Neal Norwitz <nnorwitz@gmail.com> | Fri Jul 21 05:32:28 2006 +0000 |
committer | Neal Norwitz <nnorwitz@gmail.com> | Fri Jul 21 05:32:28 2006 +0000 |
tree | cd676947643217e1aaaa4723beecc6313d9d15b6 | |
parent | 1adbb507013bea05cda92ea6aa9a8fef72657923 [diff] [blame] |
Handle allocation failures gracefully. Found with failmalloc. Many (all?) of these could be backported.
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 08fdb3f..096dfc6 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -7918,6 +7918,9 @@ unicode_freelist = NULL; unicode_freelist_size = 0; unicode_empty = _PyUnicode_New(0); + if (!unicode_empty) + return; + strcpy(unicode_default_encoding, "ascii"); for (i = 0; i < 256; i++) unicode_latin1[i] = NULL;