[Python-checkins] bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)
Pablo Galindo
webhook-mailer at python.org
Mon May 25 15:17:20 EDT 2020
https://github.com/python/cpython/commit/deb4355a37e41edf1199920789fe9572c1fb43c2
commit: deb4355a37e41edf1199920789fe9572c1fb43c2
branch: master
author: Pablo Galindo <Pablogsal at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-05-25T20:17:12+01:00
summary:
bpo-40750: Do not expand the new parser debug flags if Py_BUILD_CORE is not defined (GH-20393)
files:
M Parser/pegen/parse.c
M Tools/peg_generator/pegen/c_generator.py
diff --git a/Parser/pegen/parse.c b/Parser/pegen/parse.c
index 2b735472ad620..b63924177d400 100644
--- a/Parser/pegen/parse.c
+++ b/Parser/pegen/parse.c
@@ -1,7 +1,7 @@
// @generated by pegen.py from ./Grammar/python.gram
#include "pegen.h"
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
extern int Py_DebugFlag;
#define D(x) if (Py_DebugFlag) x;
#else
diff --git a/Tools/peg_generator/pegen/c_generator.py b/Tools/peg_generator/pegen/c_generator.py
index ff7e75a9fdfda..8bc23911bbbc2 100644
--- a/Tools/peg_generator/pegen/c_generator.py
+++ b/Tools/peg_generator/pegen/c_generator.py
@@ -29,7 +29,7 @@
EXTENSION_PREFIX = """\
#include "pegen.h"
-#ifdef Py_DEBUG
+#if defined(Py_DEBUG) && defined(Py_BUILD_CORE)
extern int Py_DebugFlag;
#define D(x) if (Py_DebugFlag) x;
#else
More information about the Python-checkins
mailing list