[Python-checkins] cpython (2.7): Call PyErr_NoMemory() when PyMem_Malloc() fails.
serhiy.storchaka
python-checkins at python.org
Mon Jul 14 11:21:29 CEST 2014
http://hg.python.org/cpython/rev/1c42f1ff2439
changeset: 91674:1c42f1ff2439
branch: 2.7
parent: 91671:aa059a8fb55a
user: Serhiy Storchaka <storchaka at gmail.com>
date: Mon Jul 14 12:20:01 2014 +0300
summary:
Call PyErr_NoMemory() when PyMem_Malloc() fails.
files:
Modules/_tkinter.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -468,8 +468,10 @@
const char *e = s + size;
PyErr_Clear();
q = buf = (char *)PyMem_Malloc(size);
- if (buf == NULL)
+ if (buf == NULL) {
+ PyErr_NoMemory();
return NULL;
+ }
while (s != e) {
if (s + 1 != e && s[0] == '\xc0' && s[1] == '\x80') {
*q++ = '\0';
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list