summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-11 22:02:55 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-11 22:02:55 (GMT)
commitcc35159ed87c27966de1a06b71e05e184303b7fc (patch)
tree380baf66b65f37042d80ad399ef9ce7577c097a7 /Python
parent9035ad932b9a7861793f7187d74051babb8b17d9 (diff)
downloadcpython-cc35159ed87c27966de1a06b71e05e184303b7fc.zip
cpython-cc35159ed87c27966de1a06b71e05e184303b7fc.tar.gz
cpython-cc35159ed87c27966de1a06b71e05e184303b7fc.tar.bz2
Issue #18408: normalizestring() now raises MemoryError on memory allocation failure
Diffstat (limited to 'Python')
-rw-r--r--Python/codecs.c2
1 files changed, 1 insertions, 1 deletions
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 @@ 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 == ' ')