diff Python/codecs.c @ 84571:4975bcd67aa7

Issue #18408: normalizestring() now raises MemoryError on memory allocation failure
author Victor Stinner <victor.stinner@gmail.com>
date Fri, 12 Jul 2013 00:02:55 +0200
parents 3a86a3f1d89a
children e7f6cef7a4cc
line wrap: on
line diff
--- a/Python/codecs.c	Thu Jul 11 23:44:46 2013 +0200
+++ b/Python/codecs.c	Fri Jul 12 00:02:55 2013 +0200
@@ -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 == ' ')