diff options
author | Victor Stinner <vstinner@python.org> | 2023-07-03 23:02:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-03 23:02:07 (GMT) |
commit | 2e92edbf6de9578b30cca8e48c4bfb2ba71ae97a (patch) | |
tree | 7cb29fc57a2a2ddc93393005fc592346d3e03d6a /Include | |
parent | f6d2bb18aba844f6bb5836797c72eb791b7f3644 (diff) | |
download | cpython-2e92edbf6de9578b30cca8e48c4bfb2ba71ae97a.zip cpython-2e92edbf6de9578b30cca8e48c4bfb2ba71ae97a.tar.gz cpython-2e92edbf6de9578b30cca8e48c4bfb2ba71ae97a.tar.bz2 |
gh-106320: Remove private _PyImport C API functions (#106383)
* Remove private _PyImport C API functions: move them to the internal
C API (pycore_import.h).
* No longer export most of these private functions.
* _testcapi avoids private _PyImport_GetModuleAttrString().
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/import.h | 20 | ||||
-rw-r--r-- | Include/internal/pycore_import.h | 20 |
2 files changed, 20 insertions, 20 deletions
diff --git a/Include/cpython/import.h b/Include/cpython/import.h index 2bca4ad..cdfdd15 100644 --- a/Include/cpython/import.h +++ b/Include/cpython/import.h @@ -4,23 +4,6 @@ PyMODINIT_FUNC PyInit__imp(void); -PyAPI_FUNC(int) _PyImport_IsInitialized(PyInterpreterState *); - -PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name); -PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module); -PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module); - -PyAPI_FUNC(void) _PyImport_AcquireLock(PyInterpreterState *interp); -PyAPI_FUNC(int) _PyImport_ReleaseLock(PyInterpreterState *interp); - -PyAPI_FUNC(int) _PyImport_FixupBuiltin( - PyObject *mod, - const char *name, /* UTF-8 encoded string */ - PyObject *modules - ); -PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, - PyObject *, PyObject *); - struct _inittab { const char *name; /* ASCII encoded string */ PyObject* (*initfunc)(void); @@ -41,6 +24,3 @@ struct _frozen { collection of frozen modules: */ PyAPI_DATA(const struct _frozen *) PyImport_FrozenModules; - -PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *); -PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *); diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h index ee93f7d..457a654 100644 --- a/Include/internal/pycore_import.h +++ b/Include/internal/pycore_import.h @@ -7,6 +7,26 @@ extern "C" { #include "pycore_time.h" // _PyTime_t +extern int _PyImport_IsInitialized(PyInterpreterState *); + +PyAPI_FUNC(PyObject *) _PyImport_GetModuleId(_Py_Identifier *name); +PyAPI_FUNC(int) _PyImport_SetModule(PyObject *name, PyObject *module); +PyAPI_FUNC(int) _PyImport_SetModuleString(const char *name, PyObject* module); + +extern void _PyImport_AcquireLock(PyInterpreterState *interp); +extern int _PyImport_ReleaseLock(PyInterpreterState *interp); + +extern int _PyImport_FixupBuiltin( + PyObject *mod, + const char *name, /* UTF-8 encoded string */ + PyObject *modules + ); +extern int _PyImport_FixupExtensionObject(PyObject*, PyObject *, + PyObject *, PyObject *); + +PyAPI_DATA(PyObject *) _PyImport_GetModuleAttr(PyObject *, PyObject *); +PyAPI_DATA(PyObject *) _PyImport_GetModuleAttrString(const char *, const char *); + struct _import_runtime_state { /* The builtin modules (defined in config.c). */ |