mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
gh-93103: Parser uses PyConfig.parser_debug instead of Py_DebugFlag (#93106)
* Replace deprecated Py_DebugFlag with PyConfig.parser_debug in the parser. * Add Parser.debug member. * Add tok_state.debug member. * Py_FrozenMain(): Replace Py_VerboseFlag with PyConfig.verbose.
This commit is contained in:
parent
d2ef66a10b
commit
5115a16831
7 changed files with 14 additions and 4 deletions
|
@ -88,6 +88,9 @@ tok_new(void)
|
|||
tok->async_def_nl = 0;
|
||||
tok->interactive_underflow = IUNDERFLOW_NORMAL;
|
||||
tok->str = NULL;
|
||||
#ifdef Py_DEBUG
|
||||
tok->debug = _Py_GetConfig()->parser_debug;
|
||||
#endif
|
||||
return tok;
|
||||
}
|
||||
|
||||
|
@ -1021,7 +1024,7 @@ tok_nextc(struct tok_state *tok)
|
|||
rc = tok_underflow_file(tok);
|
||||
}
|
||||
#if defined(Py_DEBUG)
|
||||
if (Py_DebugFlag) {
|
||||
if (tok->debug) {
|
||||
fprintf(stderr, "line[%d] = ", tok->lineno);
|
||||
print_escape(stderr, tok->cur, tok->inp - tok->cur);
|
||||
fprintf(stderr, " tok->done = %d\n", tok->done);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue