[Python-checkins] cpython: Issue #18408: normalizestring() now raises MemoryError on memory allocation

victor.stinner python-checkins at python.org
Fri Jul 12 00:59:04 CEST 2013


http://hg.python.org/cpython/rev/4975bcd67aa7
changeset:   84571:4975bcd67aa7
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jul 12 00:02:55 2013 +0200
summary:
  Issue #18408: normalizestring() now raises MemoryError on memory allocation failure

files:
  Python/codecs.c |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Python/codecs.c b/Python/codecs.c
--- 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 == ' ')

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list