diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-12 00:02:55 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-12 00:02:55 +0200 |
commit | d8f2b1a5c5a9bdf30a0950ee96de960449346355 (patch) | |
tree | f8d8925a6ca9901ff36d83c8ca03b8a85f456d33 /Python/codecs.c | |
parent | e822e9e9c1a27846eb90b5357d2692b01abe1599 (diff) | |
download | cpython-d8f2b1a5c5a9bdf30a0950ee96de960449346355.tar.gz |
Issue #18408: normalizestring() now raises MemoryError on memory allocation failure
Diffstat (limited to 'Python/codecs.c')
-rw-r--r-- | Python/codecs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/codecs.c b/Python/codecs.c index 8d9ce6f496..899f0aa748 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 == ' ') |