Mercurial > cpython-lru_cache-weakref
diff Objects/unicodeobject.c @ 40012:ab13576374b1 2.4
[Backport r50743 | neal.norwitz]
Handle allocation failures gracefully. Found with failmalloc.
Many (all?) of these could be backported.
| author | Andrew M. Kuchling <amk@amk.ca> |
|---|---|
| date | Thu, 05 Oct 2006 18:08:58 +0000 |
| parents | a9b1f404e88b |
| children | 187388c11505 |
line wrap: on
line diff
--- a/Objects/unicodeobject.c Thu Oct 05 17:30:48 2006 +0000 +++ b/Objects/unicodeobject.c Thu Oct 05 18:08:58 2006 +0000 @@ -7350,6 +7350,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;
