]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45562: Only show debug output from the parser in debug builds (GH-29140)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Fri, 22 Oct 2021 08:52:24 +0000 (09:52 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Oct 2021 08:52:24 +0000 (01:52 -0700)
Parser/tokenizer.c

index ae3874b09de48e030e0250aff4bcf2068a1b528b..789a10b28fd1b557098caa56959fb98964c8e217 100644 (file)
@@ -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;