mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-43244: Remove the PyAST_Validate() function (GH-24911)
Remove the PyAST_Validate() function. It is no longer possible to
build a AST object (mod_ty type) with the public C API. The function
was already excluded from the limited C API (PEP 384).
Rename PyAST_Validate() function to _PyAST_Validate(), move it to the
internal C API, and don't export it anymore (replace PyAPI_FUNC with
extern).
The function was added in bpo-12575 by
the commit 832bfe2ebd
.
This commit is contained in:
parent
fc980e0be1
commit
eec8e61992
7 changed files with 15 additions and 5 deletions
|
@ -551,7 +551,7 @@ validate_exprs(asdl_expr_seq *exprs, expr_context_ty ctx, int null_ok)
|
|||
}
|
||||
|
||||
int
|
||||
PyAST_Validate(mod_ty mod)
|
||||
_PyAST_Validate(mod_ty mod)
|
||||
{
|
||||
int res = 0;
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include <ctype.h>
|
||||
#include "ast.h"
|
||||
#undef Yield /* undefine macro conflicting with <winbase.h> */
|
||||
#include "pycore_ast.h" // _PyAST_Validate()
|
||||
#include "pycore_object.h" // _Py_AddToAllObjects()
|
||||
#include "pycore_pyerrors.h" // _PyErr_NoMemory()
|
||||
#include "pycore_pystate.h" // _PyThreadState_GET()
|
||||
|
@ -835,7 +836,7 @@ builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename,
|
|||
PyArena_Free(arena);
|
||||
goto error;
|
||||
}
|
||||
if (!PyAST_Validate(mod)) {
|
||||
if (!_PyAST_Validate(mod)) {
|
||||
PyArena_Free(arena);
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue