]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45562: Only show debug output from the parser in debug builds (GH-29140) (#29149) 29155/head
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 22 Oct 2021 10:14:47 +0000 (03:14 -0700)
committerGitHub <noreply@github.com>
Fri, 22 Oct 2021 10:14:47 +0000 (11:14 +0100)
(cherry picked from commit 86dfb55d2e091cf633dbd7aabcd49d96fb1f9d81)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Parser/tokenizer.c

index a076d625bbf515413cc7025232b1e53892d8a190..53c10282ce86a209709d1c5a9b9eedab834ce8f1 100644 (file)
@@ -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;