summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2021-03-24 01:23:01 (GMT)
committerGitHub <noreply@github.com>2021-03-24 01:23:01 (GMT)
commit8370e07e1e5b626e78ddc7aadbfaf248976c4454 (patch)
tree5ad56b80064a2e282bfd77442096ffab167de9ed /Parser/asdl_c.py
parent919d42d477093154a30b55d9d79f023dbbe5614a (diff)
downloadcpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.zip
cpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.tar.gz
cpython-8370e07e1e5b626e78ddc7aadbfaf248976c4454.tar.bz2
bpo-43244: Remove the pyarena.h header (GH-25007)
Remove the pyarena.h header file with functions: * PyArena_New() * PyArena_Free() * PyArena_Malloc() * PyArena_AddPyObject() These functions were undocumented, excluded from the limited C API, and were only used internally by the compiler. Add pycore_pyarena.h header. Rename functions: * PyArena_New() => _PyArena_New() * PyArena_Free() => _PyArena_Free() * PyArena_Malloc() => _PyArena_Malloc() * PyArena_AddPyObject() => _PyArena_AddPyObject()
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 73cb774..3bdeedb 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -362,7 +362,7 @@ class FunctionVisitor(PrototypeVisitor):
emit('return NULL;', 2)
emit('}', 1)
- emit("p = (%s)PyArena_Malloc(arena, sizeof(*p));" % ctype, 1);
+ emit("p = (%s)_PyArena_Malloc(arena, sizeof(*p));" % ctype, 1);
emit("if (!p)", 1)
emit("return NULL;", 2)
if union:
@@ -946,7 +946,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO
if (obj == Py_None)
obj = NULL;
if (obj) {
- if (PyArena_AddPyObject(arena, obj) < 0) {
+ if (_PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL;
return -1;
}
@@ -958,7 +958,7 @@ static int obj2ast_object(struct ast_state *Py_UNUSED(state), PyObject* obj, PyO
static int obj2ast_constant(struct ast_state *Py_UNUSED(state), PyObject* obj, PyObject** out, PyArena* arena)
{
- if (PyArena_AddPyObject(arena, obj) < 0) {
+ if (_PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL;
return -1;
}