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.
This commit is contained in:
parent
71c8b7ec04
commit
526daabf34
|
@ -138,7 +138,6 @@ parsetok(struct tok_state *tok, grammar *g, int start, perrdetail *err_ret,
|
||||||
int started = 0;
|
int started = 0;
|
||||||
|
|
||||||
if ((ps = PyParser_New(g, start)) == NULL) {
|
if ((ps = PyParser_New(g, start)) == NULL) {
|
||||||
fprintf(stderr, "no mem for new parser\n");
|
|
||||||
err_ret->error = E_NOMEM;
|
err_ret->error = E_NOMEM;
|
||||||
PyTokenizer_Free(tok);
|
PyTokenizer_Free(tok);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue