summaryrefslogtreecommitdiffstats
path: root/Include/internal
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-06-19 00:54:39 (GMT)
committerGitHub <noreply@github.com>2019-06-19 00:54:39 (GMT)
commit0a28f8d379544eee897979da0ce99f0b449b49dd (patch)
tree8bf54f5ac2e9c3fd7beff5f6fa529a4f2269f3fb /Include/internal
parent809ff1181ccc09c3b629f3d0ec66e13eaa111b2e (diff)
downloadcpython-0a28f8d379544eee897979da0ce99f0b449b49dd.zip
cpython-0a28f8d379544eee897979da0ce99f0b449b49dd.tar.gz
cpython-0a28f8d379544eee897979da0ce99f0b449b49dd.tar.bz2
bpo-36710: Add tstate parameter in import.c (GH-14218)
* Add 'tstate' parameter to many internal import.c functions. * _PyImportZip_Init() now gets 'tstate' parameter rather than 'interp'. * Add 'interp' parameter to _PyState_ClearModules() and rename it to _PyInterpreterState_ClearModules(). * Move private _PyImport_FindBuiltin() to the internal C API; add 'tstate' parameter to it. * Remove private _PyImport_AddModuleObject() from the C API: use public PyImport_AddModuleObject() instead. * Remove private _PyImport_FindExtensionObjectEx() from the C API: use private _PyImport_FindExtensionObject() instead.
Diffstat (limited to 'Include/internal')
-rw-r--r--Include/internal/pycore_import.h5
-rw-r--r--Include/internal/pycore_pylifecycle.h2
-rw-r--r--Include/internal/pycore_pystate.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/Include/internal/pycore_import.h b/Include/internal/pycore_import.h
index 6b72824..bbcd170 100644
--- a/Include/internal/pycore_import.h
+++ b/Include/internal/pycore_import.h
@@ -5,6 +5,11 @@
extern "C" {
#endif
+PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin(
+ PyThreadState *tstate,
+ const char *name /* UTF-8 encoded string */
+ );
+
extern void _PyImport_ReInitLock(void);
#ifdef __cplusplus
diff --git a/Include/internal/pycore_pylifecycle.h b/Include/internal/pycore_pylifecycle.h
index 6bfadd4..1c475b1 100644
--- a/Include/internal/pycore_pylifecycle.h
+++ b/Include/internal/pycore_pylifecycle.h
@@ -55,7 +55,7 @@ extern int _PyFloat_Init(void);
extern PyStatus _Py_HashRandomization_Init(const PyConfig *);
extern PyStatus _PyTypes_Init(void);
-extern PyStatus _PyImportZip_Init(PyInterpreterState *interp);
+extern PyStatus _PyImportZip_Init(PyThreadState *tstate);
/* Various internal finalizers */
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 3ab4009..3bfbc27 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -310,6 +310,9 @@ PyAPI_FUNC(PyThreadState *) _PyThreadState_Swap(
PyAPI_FUNC(PyStatus) _PyInterpreterState_Enable(_PyRuntimeState *runtime);
PyAPI_FUNC(void) _PyInterpreterState_DeleteExceptMain(_PyRuntimeState *runtime);
+/* Used by PyImport_Cleanup() */
+extern void _PyInterpreterState_ClearModules(PyInterpreterState *interp);
+
PyAPI_FUNC(void) _PyGILState_Reinit(_PyRuntimeState *runtime);
#ifdef __cplusplus