Commit cc35159e authored by Victor Stinner's avatar Victor Stinner

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

parent 9035ad93
......@@ -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 == ' ')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment