Issue #18408: normalizestring() now raises MemoryError on memory allocation failure

This commit is contained in:
Victor Stinner 2013-07-12 00:02:55 +02:00
parent 9035ad932b
commit cc35159ed8

View file

@ -65,7 +65,7 @@ PyObject *normalizestring(const char *string)
p = PyMem_Malloc(len + 1);
if (p == NULL)
return NULL;
return PyErr_NoMemory();
for (i = 0; i < len; i++) {
register char ch = string[i];
if (ch == ' ')