[Python-checkins] cpython: Issue #18408: parsetok() must not write into stderr on memory allocation error

victor.stinner python-checkins at python.org
Thu Jul 11 23:12:11 CEST 2013


http://hg.python.org/cpython/rev/ff93930a53c0
changeset:   84564:ff93930a53c0
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Jul 11 22:52:19 2013 +0200
summary:
  Issue #18408: parsetok() must not write into stderr on memory allocation error

The caller gets an error code and can raise a classic Python exception.

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


diff --git a/Parser/parsetok.c b/Parser/parsetok.c
--- a/Parser/parsetok.c
+++ b/Parser/parsetok.c
@@ -178,7 +178,6 @@
         len = b - a; /* XXX this may compute NULL - NULL */
         str = (char *) PyObject_MALLOC(len + 1);
         if (str == NULL) {
-            fprintf(stderr, "no mem for next token\n");
             err_ret->error = E_NOMEM;
             break;
         }

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list