diff options
author | Victor Stinner <vstinner@python.org> | 2021-03-24 00:51:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 00:51:50 +0100 |
commit | a81fca6ec8e0f748f8eafa12fb12cf9e12df465c (patch) | |
tree | 955b952d9953f5ba3ed487512ac9f67267ddd4f4 /Python/pythonrun.c | |
parent | f0a6fde8827d5d4f7a1c741ab1a8b206b66ffd57 (diff) | |
download | cpython-git-a81fca6ec8e0f748f8eafa12fb12cf9e12df465c.tar.gz |
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()
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 02fd8b0b8b..e16835b13e 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -13,6 +13,7 @@ #include "pycore_ast.h" // PyAST_mod2obj #undef Yield /* undefine macro conflicting with <winbase.h> */ +#include "pycore_compile.h" // _PyAST_Compile() #include "pycore_interp.h" // PyInterpreterState.importlib #include "pycore_object.h" // _PyDebug_PrintTotalRefs() #include "pycore_pyerrors.h" // _PyErr_Fetch @@ -1224,7 +1225,7 @@ run_mod(mod_ty mod, PyObject *filename, PyObject *globals, PyObject *locals, PyCompilerFlags *flags, PyArena *arena) { PyThreadState *tstate = _PyThreadState_GET(); - PyCodeObject *co = PyAST_CompileObject(mod, filename, flags, -1, arena); + PyCodeObject *co = _PyAST_Compile(mod, filename, flags, -1, arena); if (co == NULL) return NULL; @@ -1301,7 +1302,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, PyArena_Free(arena); return result; } - co = PyAST_CompileObject(mod, filename, flags, optimize, arena); + co = _PyAST_Compile(mod, filename, flags, optimize, arena); PyArena_Free(arena); return (PyObject *)co; } |