]> granicus.if.org Git - python/commitdiff
Issue #18408: parsetok() must not write into stderr on memory allocation error
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 11 Jul 2013 21:17:33 +0000 (23:17 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 11 Jul 2013 21:17:33 +0000 (23:17 +0200)
The caller gets an error code and can raise a classic Python exception.

Parser/parsetok.c

index 7abc612831c3f70ea06a1dc9153a59404f619a72..d61ba924b565163275a67782ca6648c2e851f761 100644 (file)
@@ -138,7 +138,6 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
     int started = 0;
 
     if ((ps = PyParser_New(g, start)) == NULL) {
-        fprintf(stderr, "no mem for new parser\n");
         err_ret->error = E_NOMEM;
         PyTokenizer_Free(tok);
         return NULL;