summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-03 03:40:00 (GMT)
committerGitHub <noreply@github.com>2023-05-03 03:40:00 (GMT)
commit292076a9aa29aba1023340a0d24252a7b27a454e (patch)
tree3268355a188506819fe9399401b65d55587f9e8e /Python
parentde64e7561680fdc5358001e9488091e75d4174a3 (diff)
downloadcpython-292076a9aa29aba1023340a0d24252a7b27a454e.zip
cpython-292076a9aa29aba1023340a0d24252a7b27a454e.tar.gz
cpython-292076a9aa29aba1023340a0d24252a7b27a454e.tar.bz2
gh-104109: Expose Py_NewInterpreterFromConfig() in the Public C-API (gh-104110)
We also expose PyInterpreterConfig. This is part of the PEP 684 (per-interpreter GIL) implementation. We will add docs as soon as we can. FYI, I'm adding the new config field for per-interpreter GIL in gh-99114.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index b8a1152..b9add89 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -546,7 +546,8 @@ pycore_init_runtime(_PyRuntimeState *runtime,
static PyStatus
-init_interp_settings(PyInterpreterState *interp, const _PyInterpreterConfig *config)
+init_interp_settings(PyInterpreterState *interp,
+ const PyInterpreterConfig *config)
{
assert(interp->feature_flags == 0);
@@ -631,7 +632,7 @@ pycore_create_interpreter(_PyRuntimeState *runtime,
return status;
}
- const _PyInterpreterConfig config = _PyInterpreterConfig_LEGACY_INIT;
+ const PyInterpreterConfig config = _PyInterpreterConfig_LEGACY_INIT;
status = init_interp_settings(interp, &config);
if (_PyStatus_EXCEPTION(status)) {
return status;
@@ -1991,7 +1992,7 @@ Py_Finalize(void)
*/
static PyStatus
-new_interpreter(PyThreadState **tstate_p, const _PyInterpreterConfig *config)
+new_interpreter(PyThreadState **tstate_p, const PyInterpreterConfig *config)
{
PyStatus status;
@@ -2079,8 +2080,8 @@ error:
}
PyStatus
-_Py_NewInterpreterFromConfig(PyThreadState **tstate_p,
- const _PyInterpreterConfig *config)
+Py_NewInterpreterFromConfig(PyThreadState **tstate_p,
+ const PyInterpreterConfig *config)
{
return new_interpreter(tstate_p, config);
}
@@ -2089,8 +2090,8 @@ PyThreadState *
Py_NewInterpreter(void)
{
PyThreadState *tstate = NULL;
- const _PyInterpreterConfig config = _PyInterpreterConfig_LEGACY_INIT;
- PyStatus status = _Py_NewInterpreterFromConfig(&tstate, &config);
+ const PyInterpreterConfig config = _PyInterpreterConfig_LEGACY_INIT;
+ PyStatus status = new_interpreter(&tstate, &config);
if (_PyStatus_EXCEPTION(status)) {
Py_ExitStatusException(status);
}