[Python-checkins] bpo-45562: Only show debug output from the parser in debug builds (GH-29140) (#29149)

pablogsal webhook-mailer at python.org
Fri Oct 22 06:14:53 EDT 2021


https://github.com/python/cpython/commit/ae78ffdc9399802621eabcd1668e44a91ec5f45e
commit: ae78ffdc9399802621eabcd1668e44a91ec5f45e
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2021-10-22T11:14:47+01:00
summary:

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 at gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal at gmail.com>

files:
M Parser/tokenizer.c

diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index a076d625bbf51..53c10282ce86a 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;



More information about the Python-checkins mailing list