From 86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Fri, 22 Oct 2021 09:52:24 +0100 Subject: [PATCH] bpo-45562: Only show debug output from the parser in debug builds (GH-29140) --- Parser/tokenizer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index ae3874b09de..789a10b28fd 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -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;