From 3bf5f530d91c8b55c10e10153d8224e72ed7b279 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 11 Jul 2013 22:52:19 +0200 Subject: [PATCH] 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. --- Parser/parsetok.c | 1 - 1 file changed, 1 deletion(-) 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; } -- 2.50.1