From d12c2afbb6555d74d4bad8a53e66b0100e23b7ab Mon Sep 17 00:00:00 2001 From: Theelgirl Date: Tue, 2 Mar 2021 18:27:11 -0800 Subject: [PATCH 1/2] Allow compilation on python 3.10.0a6 --- ast27/Parser/tokenizer.c | 7 ++++++- ast27/Python/ast.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ast27/Parser/tokenizer.c b/ast27/Parser/tokenizer.c index 4db0b5a8..942956b8 100644 --- a/ast27/Parser/tokenizer.c +++ b/ast27/Parser/tokenizer.c @@ -16,9 +16,14 @@ #include "fileobject.h" #include "codecs.h" #include "abstract.h" -#include "pydebug.h" #endif /* PGEN */ +#if PY_MINOR_VERSION >= 10 +#include "cpython/pydebug.h" +#else +#include "pydebug.h" +#endif + #if PY_MINOR_VERSION >= 4 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); #else diff --git a/ast27/Python/ast.c b/ast27/Python/ast.c index 367973c2..d1654c27 100644 --- a/ast27/Python/ast.c +++ b/ast27/Python/ast.c @@ -7,13 +7,18 @@ #include "../Include/Python-ast.h" #include "../Include/grammar.h" #include "../Include/node.h" -#include "pyarena.h" #include "../Include/ast.h" #include "../Include/token.h" #include "../Include/parsetok.h" #include "../Include/graminit.h" #include "unicodeobject.h" +#if PY_MINOR_VERSION >= 10 +#include "cpython/pyarena.h" +#else +#include "pyarena.h" +#endif + #include /* Data structure used internally */ From 7ae9e1d871a2be4c6f53ac9b8735f7eef72f2e4f Mon Sep 17 00:00:00 2001 From: Theelgirl Date: Tue, 2 Mar 2021 19:09:47 -0800 Subject: [PATCH 2/2] Just remove troublesome includes entirely --- ast27/Parser/tokenizer.c | 6 ------ ast27/Python/ast.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/ast27/Parser/tokenizer.c b/ast27/Parser/tokenizer.c index 942956b8..774b452e 100644 --- a/ast27/Parser/tokenizer.c +++ b/ast27/Parser/tokenizer.c @@ -18,12 +18,6 @@ #include "abstract.h" #endif /* PGEN */ -#if PY_MINOR_VERSION >= 10 -#include "cpython/pydebug.h" -#else -#include "pydebug.h" -#endif - #if PY_MINOR_VERSION >= 4 PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, const char *); #else diff --git a/ast27/Python/ast.c b/ast27/Python/ast.c index d1654c27..c681d070 100644 --- a/ast27/Python/ast.c +++ b/ast27/Python/ast.c @@ -13,12 +13,6 @@ #include "../Include/graminit.h" #include "unicodeobject.h" -#if PY_MINOR_VERSION >= 10 -#include "cpython/pyarena.h" -#else -#include "pyarena.h" -#endif - #include /* Data structure used internally */