From a81fca6ec8e0f748f8eafa12fb12cf9e12df465c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Wed, 24 Mar 2021 00:51:50 +0100 Subject: bpo-43244: Add pycore_compile.h header file (GH-25000) Remove the compiler functions using "struct _mod" type, because the public AST C API was removed: * PyAST_Compile() * PyAST_CompileEx() * PyAST_CompileObject() * PyFuture_FromAST() * PyFuture_FromASTObject() These functions were undocumented and excluded from the limited C API. Rename functions: * PyAST_CompileObject() => _PyAST_Compile() * PyFuture_FromASTObject() => _PyFuture_FromAST() Moreover, _PyFuture_FromAST() is no longer exported (replace PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for test_peg_generator. Remove also compatibility functions: * PyAST_Compile() * PyAST_CompileEx() * PyFuture_FromAST() --- Python/bltinmodule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index fd9b97f8e9..afe0f820cf 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -4,6 +4,7 @@ #include #include "pycore_ast.h" // _PyAST_Validate() #undef Yield /* undefine macro conflicting with */ +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_object.h" // _Py_AddToAllObjects() #include "pycore_pyerrors.h" // _PyErr_NoMemory() #include "pycore_pystate.h" // _PyThreadState_GET() @@ -839,8 +840,8 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, PyArena_Free(arena); goto error; } - result = (PyObject*)PyAST_CompileObject(mod, filename, - &cf, optimize, arena); + result = (PyObject*)_PyAST_Compile(mod, filename, + &cf, optimize, arena); PyArena_Free(arena); } goto finally; -- cgit v1.2.1