| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 32eba61 commit 28ad12f
15 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -776,7 +776,6 @@ Py_SetPath | |||
| 776 | 776 | Py_SetProgramName | |
| 777 | 777 | Py_SetPythonHome | |
| 778 | 778 | Py_SetRecursionLimit | |
| 779 | - Py_SymtableString | ||
| 780 | 779 | Py_UTF8Mode | |
| 781 | 780 | Py_VaBuildValue | |
| 782 | 781 | Py_XNewRef | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1364,3 +1364,19 @@ Removed | |||
| 1364 | 1364 | AST object (``mod_ty`` type) with the public C API. The function was already | |
| 1365 | 1365 | excluded from the limited C API (:pep:`384`). | |
| 1366 | 1366 | (Contributed by Victor Stinner in :issue:`43244`.) | |
| 1367 | + | ||
| 1368 | + * Remove the ``symtable.h`` header file and the undocumented functions: | ||
| 1369 | + | ||
| 1370 | + * ``PyST_GetScope()`` | ||
| 1371 | + * ``PySymtable_Build()`` | ||
| 1372 | + * ``PySymtable_BuildObject()`` | ||
| 1373 | + * ``PySymtable_Free()`` | ||
| 1374 | + * ``Py_SymtableString()`` | ||
| 1375 | + * ``Py_SymtableStringObject()`` | ||
| 1376 | + | ||
| 1377 | + The ``Py_SymtableString()`` function was part the stable ABI by mistake but | ||
| 1378 | + it could not be used, because the ``symtable.h`` header file was excluded | ||
| 1379 | + from the limited C API. | ||
| 1380 | + | ||
| 1381 | + The Python :mod:`symtable` module remains available and is unchanged. | ||
| 1382 | + (Contributed by Victor Stinner in :issue:`43244`.) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -77,17 +77,6 @@ PyAPI_FUNC(const char *) _Py_SourceAsString( | |||
| 77 | 77 | PyCompilerFlags *cf, | |
| 78 | 78 | PyObject **cmd_copy); | |
| 79 | 79 | ||
| 80 | - PyAPI_FUNC(struct symtable *) Py_SymtableStringObject( | ||
| 81 | - const char *str, | ||
| 82 | - PyObject *filename, | ||
| 83 | - int start); | ||
| 84 | - | ||
| 85 | - PyAPI_FUNC(struct symtable *) _Py_SymtableStringObjectFlags( | ||
| 86 | - const char *str, | ||
| 87 | - PyObject *filename, | ||
| 88 | - int start, | ||
| 89 | - PyCompilerFlags *flags); | ||
| 90 | - | ||
| 91 | 80 | ||
| 92 | 81 | /* A function flavor is also exported by libpython. It is required when | |
| 93 | 82 | libpython is accessed directly rather than using header files which defines | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,15 +1,14 @@ | |||
| 1 | - #ifndef Py_LIMITED_API | ||
| 2 | - #ifndef Py_SYMTABLE_H | ||
| 3 | - #define Py_SYMTABLE_H | ||
| 1 | + #ifndef Py_INTERNAL_SYMTABLE_H | ||
| 2 | + #define Py_INTERNAL_SYMTABLE_H | ||
| 4 | 3 | #ifdef __cplusplus | |
| 5 | 4 | extern "C" { | |
| 6 | 5 | #endif | |
| 7 | 6 | ||
| 8 | - #include "Python-ast.h" /* mod_ty */ | ||
| 7 | + #ifndef Py_BUILD_CORE | ||
| 8 | + # error "this header requires Py_BUILD_CORE define" | ||
| 9 | + #endif | ||
| 9 | 10 | ||
| 10 | - /* XXX(ncoghlan): This is a weird mix of public names and interpreter internal | ||
| 11 | - * names. | ||
| 12 | - */ | ||
| 11 | + #include "Python-ast.h" /* mod_ty */ | ||
| 13 | 12 | ||
| 14 | 13 | typedef enum _block_type { FunctionBlock, ClassBlock, ModuleBlock } | |
| 15 | 14 | _Py_block_ty; | |
@@ -68,23 +67,19 @@ typedef struct _symtable_entry { | |||
| 68 | 67 | struct symtable *ste_table; | |
| 69 | 68 | } PySTEntryObject; | |
| 70 | 69 | ||
| 71 | - PyAPI_DATA(PyTypeObject) PySTEntry_Type; | ||
| 70 | + extern PyTypeObject PySTEntry_Type; | ||
| 72 | 71 | ||
| 73 | 72 | #define PySTEntry_Check(op) Py_IS_TYPE(op, &PySTEntry_Type) | |
| 74 | 73 | ||
| 75 | - PyAPI_FUNC(int) PyST_GetScope(PySTEntryObject *, PyObject *); | ||
| 74 | + extern int _PyST_GetScope(PySTEntryObject *, PyObject *); | ||
| 76 | 75 | ||
| 77 | - PyAPI_FUNC(struct symtable *) PySymtable_Build( | ||
| 78 | - mod_ty mod, | ||
| 79 | - const char *filename, /* decoded from the filesystem encoding */ | ||
| 80 | - PyFutureFeatures *future); | ||
| 81 | - PyAPI_FUNC(struct symtable *) PySymtable_BuildObject( | ||
| 76 | + extern struct symtable* _PySymtable_Build( | ||
| 82 | 77 | mod_ty mod, | |
| 83 | 78 | PyObject *filename, | |
| 84 | 79 | PyFutureFeatures *future); | |
| 85 | 80 | PyAPI_FUNC(PySTEntryObject *) PySymtable_Lookup(struct symtable *, void *); | |
| 86 | 81 | ||
| 87 | - PyAPI_FUNC(void) PySymtable_Free(struct symtable *); | ||
| 82 | + extern void _PySymtable_Free(struct symtable *); | ||
| 88 | 83 | ||
| 89 | 84 | /* Flags for def-use information */ | |
| 90 | 85 | ||
@@ -117,8 +112,14 @@ PyAPI_FUNC(void) PySymtable_Free(struct symtable *); | |||
| 117 | 112 | #define GENERATOR 1 | |
| 118 | 113 | #define GENERATOR_EXPRESSION 2 | |
| 119 | 114 | ||
| 115 | + // Used by symtablemodule.c | ||
| 116 | + extern struct symtable* _Py_SymtableStringObjectFlags( | ||
| 117 | + const char *str, | ||
| 118 | + PyObject *filename, | ||
| 119 | + int start, | ||
| 120 | + PyCompilerFlags *flags); | ||
| 121 | + | ||
| 120 | 122 | #ifdef __cplusplus | |
| 121 | 123 | } | |
| 122 | 124 | #endif | |
| 123 | - #endif /* !Py_SYMTABLE_H */ | ||
| 124 | - #endif /* !Py_LIMITED_API */ | ||
| 125 | + #endif /* !Py_INTERNAL_SYMTABLE_H */ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,11 +9,6 @@ extern "C" { | |||
| 9 | 9 | ||
| 10 | 10 | PyAPI_FUNC(PyObject *) Py_CompileString(const char *, const char *, int); | |
| 11 | 11 | ||
| 12 | - PyAPI_FUNC(struct symtable *) Py_SymtableString( | ||
| 13 | - const char *str, | ||
| 14 | - const char *filename, /* decoded from the filesystem encoding */ | ||
| 15 | - int start); | ||
| 16 | - | ||
| 17 | 12 | PyAPI_FUNC(void) PyErr_Print(void); | |
| 18 | 13 | PyAPI_FUNC(void) PyErr_PrintEx(int); | |
| 19 | 14 | PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1087,7 +1087,6 @@ PYTHON_HEADERS= \ | |||
| 1087 | 1087 | $(srcdir)/Include/sliceobject.h \ | |
| 1088 | 1088 | $(srcdir)/Include/structmember.h \ | |
| 1089 | 1089 | $(srcdir)/Include/structseq.h \ | |
| 1090 | - $(srcdir)/Include/symtable.h \ | ||
| 1091 | 1090 | $(srcdir)/Include/sysmodule.h \ | |
| 1092 | 1091 | $(srcdir)/Include/token.h \ | |
| 1093 | 1092 | $(srcdir)/Include/traceback.h \ | |
@@ -1167,6 +1166,7 @@ PYTHON_HEADERS= \ | |||
| 1167 | 1166 | $(srcdir)/Include/internal/pycore_pymem.h \ | |
| 1168 | 1167 | $(srcdir)/Include/internal/pycore_pystate.h \ | |
| 1169 | 1168 | $(srcdir)/Include/internal/pycore_runtime.h \ | |
| 1169 | + $(srcdir)/Include/internal/pycore_symtable.h \ | ||
| 1170 | 1170 | $(srcdir)/Include/internal/pycore_sysmodule.h \ | |
| 1171 | 1171 | $(srcdir)/Include/internal/pycore_traceback.h \ | |
| 1172 | 1172 | $(srcdir)/Include/internal/pycore_tuple.h \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,16 @@ | |||
| 1 | + Remove the ``symtable.h`` header file and the undocumented functions: | ||
| 2 | + | ||
| 3 | + * ``PyST_GetScope()`` | ||
| 4 | + * ``PySymtable_Build()`` | ||
| 5 | + * ``PySymtable_BuildObject()`` | ||
| 6 | + * ``PySymtable_Free()`` | ||
| 7 | + * ``Py_SymtableString()`` | ||
| 8 | + * ``Py_SymtableStringObject()`` | ||
| 9 | + | ||
| 10 | + The ``Py_SymtableString()`` function was part the stable ABI by mistake but it | ||
| 11 | + could not be used, because the ``symtable.h`` header file was excluded from the | ||
| 12 | + limited C API. | ||
| 13 | + | ||
| 14 | + The Python :mod:`symtable` module remains available and is unchanged. | ||
| 15 | + | ||
| 16 | + Patch by Victor Stinner. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,7 @@ | |||
| 1 | 1 | #include "Python.h" | |
| 2 | 2 | ||
| 3 | - #include "code.h" | ||
| 4 | 3 | #include "Python-ast.h" | |
| 5 | - #include "symtable.h" | ||
| 4 | + #include "pycore_symtable.h" // struct symtable | ||
| 6 | 5 | ||
| 7 | 6 | #include "clinic/symtablemodule.c.h" | |
| 8 | 7 | /*[clinic input] | |
@@ -62,7 +61,7 @@ _symtable_symtable_impl(PyObject *module, PyObject *source, | |||
| 62 | 61 | t = (PyObject *)st->st_top; | |
| 63 | 62 | Py_INCREF(t); | |
| 64 | 63 | PyMem_Free((void *)st->st_future); | |
| 65 | - PySymtable_Free(st); | ||
| 64 | + _PySymtable_Free(st); | ||
| 66 | 65 | return t; | |
| 67 | 66 | } | |
| 68 | 67 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -80,7 +80,6 @@ EXPORT_FUNC(Py_SetPath) | |||
| 80 | 80 | EXPORT_FUNC(Py_SetProgramName) | |
| 81 | 81 | EXPORT_FUNC(Py_SetPythonHome) | |
| 82 | 82 | EXPORT_FUNC(Py_SetRecursionLimit) | |
| 83 | - EXPORT_FUNC(Py_SymtableString) | ||
| 84 | 83 | EXPORT_FUNC(Py_VaBuildValue) | |
| 85 | 84 | EXPORT_FUNC(Py_XNewRef) | |
| 86 | 85 | EXPORT_FUNC(PyArg_Parse) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -208,6 +208,7 @@ | |||
| 208 | 208 | <ClInclude Include="..\Include\internal\pycore_pystate.h" /> | |
| 209 | 209 | <ClInclude Include="..\Include\internal\pycore_runtime.h" /> | |
| 210 | 210 | <ClInclude Include="..\Include\internal\pycore_sysmodule.h" /> | |
| 211 | + <ClInclude Include="..\Include\internal\pycore_symtable.h" /> | ||
| 211 | 212 | <ClInclude Include="..\Include\internal\pycore_traceback.h" /> | |
| 212 | 213 | <ClInclude Include="..\Include\internal\pycore_tuple.h" /> | |
| 213 | 214 | <ClInclude Include="..\Include\internal\pycore_ucnhash.h" /> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments