Commit 3bf5f530 authored by Victor Stinner's avatar Victor Stinner

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.
parent 6b64a680
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment