[Python-checkins] cpython (3.3): Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()

stefan.krah python-checkins at python.org
Fri Nov 8 21:14:19 CET 2013


http://hg.python.org/cpython/rev/3ff670a83c73
changeset:   87016:3ff670a83c73
branch:      3.3
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Tue Oct 29 20:33:14 2013 +0100
summary:
  Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()
failure (memory allocation failure): raise a MemoryError exception

files:
  Modules/_decimal/_decimal.c |  1 +
  1 files changed, 1 insertions(+), 0 deletions(-)


diff --git a/Modules/_decimal/_decimal.c b/Modules/_decimal/_decimal.c
--- a/Modules/_decimal/_decimal.c
+++ b/Modules/_decimal/_decimal.c
@@ -3187,6 +3187,7 @@
             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