]> granicus.if.org Git - python/commitdiff
Port rev 55353 from Guido:
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 16 May 2007 04:33:50 +0000 (04:33 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 16 May 2007 04:33:50 +0000 (04:33 +0000)
Add what looks like a necessary call to PyErr_NoMemory() when PyMem_MALLOC()
fails.

Will backport.

Objects/intobject.c

index 9333a55873aaf5181628a560feb06f95f0cc7c93..f72aea0fab033febec2f80a5bd60fd105a84163b 100644 (file)
@@ -393,7 +393,7 @@ PyInt_FromUnicode(Py_UNICODE *s, Py_ssize_t length, int base)
        char *buffer = (char *)PyMem_MALLOC(length+1);
 
        if (buffer == NULL)
-               return NULL;
+               return PyErr_NoMemory();
 
        if (PyUnicode_EncodeDecimal(s, length, buffer, NULL)) {
                PyMem_FREE(buffer);