[Python-checkins] cpython: Move PyErr_NoMemory() closer to the failure.
stefan.krah
python-checkins at python.org
Fri Nov 8 20:38:19 CET 2013
http://hg.python.org/cpython/rev/9fc542fdb030
changeset: 87012:9fc542fdb030
user: Stefan Krah <skrah at bytereef.org>
date: Fri Nov 08 18:05:02 2013 +0100
summary:
Move PyErr_NoMemory() closer to the failure.
files:
Modules/_decimal/_decimal.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3108,6 +3108,7 @@
{
char *dest = PyMem_Malloc(size+1);
if (dest == NULL) {
+ PyErr_NoMemory();
return NULL;
}
@@ -3186,7 +3187,6 @@
replace_fillchar = 1;
fmt = dec_strdup(fmt, size);
if (fmt == NULL) {
- PyErr_NoMemory();
return NULL;
}
fmt[0] = '_';
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list