diff options
author | Victor Stinner <vstinner@python.org> | 2021-03-19 12:41:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-19 12:41:49 +0100 |
commit | 28ad12f8fe889a741661eb99daacebd9243cc1ba (patch) | |
tree | 0519e059d23700bc0d9fe9b1bd4601559e49dbb4 /Python/pythonrun.c | |
parent | 32eba61ea431c76f15a910c0a4eded7f5f8b9b34 (diff) | |
download | cpython-git-28ad12f8fe889a741661eb99daacebd9243cc1ba.tar.gz |
bpo-43244: Remove symtable.h header file (GH-24910)
Rename Include/symtable.h to to Include/internal/pycore_symtable.h,
don't export symbols anymore (replace PyAPI_FUNC and PyAPI_DATA with
extern) and rename functions:
* PyST_GetScope() to _PyST_GetScope()
* PySymtable_BuildObject() to _PySymtable_Build()
* PySymtable_Free() to _PySymtable_Free()
Remove PySymtable_Build(), Py_SymtableString() and
Py_SymtableStringObject() functions.
The Py_SymtableString() function was part the stable ABI by mistake
but it could not be used, since the symtable.h header file was
excluded from the limited C API.
The Python symtable module remains available and is unchanged.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 338a1b96d3..adb43e75f9 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -23,7 +23,6 @@ #include "token.h" // INDENT #include "errcode.h" // E_EOF #include "code.h" // PyCodeObject -#include "symtable.h" // PySymtable_BuildObject() #include "marshal.h" // PyMarshal_ReadLongFromFile() #ifdef MS_WINDOWS @@ -1369,48 +1368,6 @@ _Py_SourceAsString(PyObject *cmd, const char *funcname, const char *what, PyComp return str; } -struct symtable * -Py_SymtableStringObject(const char *str, PyObject *filename, int start) -{ - PyCompilerFlags flags = _PyCompilerFlags_INIT; - return _Py_SymtableStringObjectFlags(str, filename, start, &flags); -} - -struct symtable * -_Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, PyCompilerFlags *flags) -{ - struct symtable *st; - mod_ty mod; - PyArena *arena; - - arena = PyArena_New(); - if (arena == NULL) - return NULL; - - mod = PyParser_ASTFromStringObject(str, filename, start, flags, arena); - if (mod == NULL) { - PyArena_Free(arena); - return NULL; - } - st = PySymtable_BuildObject(mod, filename, 0); - PyArena_Free(arena); - return st; -} - -struct symtable * -Py_SymtableString(const char *str, const char *filename_str, int start) -{ - PyObject *filename; - struct symtable *st; - - filename = PyUnicode_DecodeFSDefault(filename_str); - if (filename == NULL) - return NULL; - st = Py_SymtableStringObject(str, filename, start); - Py_DECREF(filename); - return st; -} - #if defined(USE_STACKCHECK) #if defined(WIN32) && defined(_MSC_VER) |