Issue #18408: normalizestring() now raises MemoryError on memory allocation failure
diff --git a/Python/codecs.c b/Python/codecs.c
index 8d9ce6f..899f0aa 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -65,7 +65,7 @@
 
     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 == ' ')