]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43244: Fix test_peg_generators on Windows (GH-24913)
authorVictor Stinner <vstinner@python.org>
Thu, 18 Mar 2021 08:54:13 +0000 (09:54 +0100)
committerGitHub <noreply@github.com>
Thu, 18 Mar 2021 08:54:13 +0000 (09:54 +0100)
Don't redefine Py_DebugFlag, it's already defined in pydebug.h which
is included by Python.h

Parser/parser.c
Tools/peg_generator/pegen/c_generator.py

index acfaf80094c0fe47754b5d4365496fc65b9a5d4a..6efaebe179b9c9505a2b4886a4ca16dd8104f706 100644 (file)
@@ -2,10 +2,9 @@
 #include "pegen.h"
 
 #if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
-extern int Py_DebugFlag;
-#define D(x) if (Py_DebugFlag) x;
+#  define D(x) if (Py_DebugFlag) x;
 #else
-#define D(x)
+#  define D(x)
 #endif
 static const int n_keyword_lists = 9;
 static KeywordToken *reserved_keywords[] = {
index 929ec4f547e17262dfba9a2e16429095683b5557..24418ea70e448be63348b234d0a2ef8da9c525b1 100644 (file)
@@ -31,10 +31,9 @@ EXTENSION_PREFIX = """\
 #include "pegen.h"
 
 #if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
-extern int Py_DebugFlag;
-#define D(x) if (Py_DebugFlag) x;
+#  define D(x) if (Py_DebugFlag) x;
 #else
-#define D(x)
+#  define D(x)
 #endif
 
 """