From: Victor Stinner Date: Thu, 11 Jul 2013 20:52:19 +0000 (+0200) Subject: Issue #18408: parsetok() must not write into stderr on memory allocation error X-Git-Tag: v3.4.0a1~251 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bf5f530d91c8b55c10e10153d8224e72ed7b279;p=python 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. --- diff --git a/Parser/parsetok.c b/Parser/parsetok.c index 7beb735d15..7abc612831 100644 --- a/Parser/parsetok.c +++ b/Parser/parsetok.c @@ -178,7 +178,6 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret, 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; }