Skip to content

Commit ae78ffd

Browse files
bpo-45562: Only show debug output from the parser in debug builds (GH-29140) (#29149)
(cherry picked from commit 86dfb55) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
1 parent 8f6aa48 commit ae78ffd

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Parser/tokenizer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,11 +1042,13 @@ tok_nextc(struct tok_state *tok)
10421042
else {
10431043
rc = tok_underflow_file(tok);
10441044
}
1045+
#if defined(Py_DEBUG)
10451046
if (Py_DebugFlag) {
10461047
printf("line[%d] = ", tok->lineno);
10471048
print_escape(stdout, tok->cur, tok->inp - tok->cur);
10481049
printf(" tok->done = %d\n", tok->done);
10491050
}
1051+
#endif
10501052
if (!rc) {
10511053
tok->cur = tok->inp;
10521054
return EOF;

0 commit comments

Comments
 (0)