Skip to content

Commit

Permalink
bpo-45562: Only show debug output from the parser in debug builds (py…
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Oct 22, 2021
1 parent 276468d commit 86dfb55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Parser/tokenizer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,11 +1043,13 @@ tok_nextc(struct tok_state *tok)
else {
rc = tok_underflow_file(tok);
}
#if defined(Py_DEBUG)
if (Py_DebugFlag) {
printf("line[%d] = ", tok->lineno);
print_escape(stdout, tok->cur, tok->inp - tok->cur);
printf(" tok->done = %d\n", tok->done);
}
#endif
if (!rc) {
tok->cur = tok->inp;
return EOF;
Expand Down

0 comments on commit 86dfb55

Please sign in to comment.