bpo-43244: Fix test_peg_generators on Windows (GH-24913)

Don't redefine Py_DebugFlag, it's already defined in pydebug.h which
is included by Python.h
This commit is contained in:
Victor Stinner 2021-03-18 09:54:13 +01:00 committed by GitHub
parent e0b4aa0f5c
commit 6af528b4ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -2,10 +2,9 @@
#include "pegen.h" #include "pegen.h"
#if defined(Py_DEBUG) && defined(Py_BUILD_CORE) #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 #else
#define D(x) # define D(x)
#endif #endif
static const int n_keyword_lists = 9; static const int n_keyword_lists = 9;
static KeywordToken *reserved_keywords[] = { static KeywordToken *reserved_keywords[] = {

View File

@ -31,10 +31,9 @@ EXTENSION_PREFIX = """\
#include "pegen.h" #include "pegen.h"
#if defined(Py_DEBUG) && defined(Py_BUILD_CORE) #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 #else
#define D(x) # define D(x)
#endif #endif
""" """