summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-10-22 10:14:47 (GMT)
committerGitHub <noreply@github.com>2021-10-22 10:14:47 (GMT)
commitae78ffdc9399802621eabcd1668e44a91ec5f45e (patch)
treed7af483ed0610a37316a35245dfd899f4e08756f /Parser
parent8f6aa48cb2dc827a2cb76e35e91bf02d099875c5 (diff)
downloadcpython-ae78ffdc9399802621eabcd1668e44a91ec5f45e.zip
cpython-ae78ffdc9399802621eabcd1668e44a91ec5f45e.tar.gz
cpython-ae78ffdc9399802621eabcd1668e44a91ec5f45e.tar.bz2
bpo-45562: Only show debug output from the parser in debug builds (GH-29140) (#29149)
(cherry picked from commit 86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com> Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index a076d62..53c1028 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -1042,11 +1042,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;