aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-10 21:10:22 +0100
committerGitHub <noreply@github.com>2020-11-10 21:10:22 +0100
commitace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0 (patch)
tree2d4d60ce52caedd15d8825c2fc2842340ae21d31 /Python/pylifecycle.c
parentbpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#2... (diff)
downloadcpython-ace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0.tar.gz
cpython-ace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0.tar.bz2
cpython-ace3f9a0ce7b9fe8ae757fdd614f1e7a171f92b0.zip
bpo-42260: Fix _PyConfig_Read() if compute_path_config=0 (GH-23220)
Fix _PyConfig_Read() if compute_path_config=0: use values set by Py_SetPath(), Py_SetPythonHome() and Py_SetProgramName(). Add compute_path_config parameter to _PyConfig_InitPathConfig(). The following functions now return NULL if called before Py_Initialize(): * Py_GetExecPrefix() * Py_GetPath() * Py_GetPrefix() * Py_GetProgramFullPath() * Py_GetProgramName() * Py_GetPythonHome() These functions no longer automatically computes the Python Path Configuration. Moreover, Py_SetPath() no longer computes program_full_path.
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r--Python/pylifecycle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index 609e0a42e4d..93bce49b63d 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1039,7 +1039,7 @@ init_interp_main(PyThreadState *tstate)
}
// Compute the path configuration
- status = _PyConfig_InitPathConfig(&interp->config);
+ status = _PyConfig_InitPathConfig(&interp->config, 1);
if (_PyStatus_EXCEPTION(status)) {
return status;
}