summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-05 17:12:33 (GMT)
committerGitHub <noreply@github.com>2020-11-05 17:12:33 (GMT)
commitf3cb81431574453aac3b6dcadb3120331e6a8f1c (patch)
tree05f4c4cf4ae0625a76a118856e9fa7dbcd520adf /Python/sysmodule.c
parent4662fa9bfe4a849fe87bfb321d8ef0956c89a772 (diff)
downloadcpython-f3cb81431574453aac3b6dcadb3120331e6a8f1c.zip
cpython-f3cb81431574453aac3b6dcadb3120331e6a8f1c.tar.gz
cpython-f3cb81431574453aac3b6dcadb3120331e6a8f1c.tar.bz2
bpo-42260: Add _PyConfig_FromDict() (GH-23167)
* Rename config_as_dict() to _PyConfig_AsDict(). * Add 'module_search_paths_set' to _PyConfig_AsDict(). * Add _PyConfig_FromDict(). * Add get_config() and set_config() to _testinternalcapi. * Add config_check_consistency().
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 60b2494..ae4f0ee 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2922,7 +2922,9 @@ _PySys_UpdateConfig(PyThreadState *tstate)
#define SET_SYS_FROM_WSTR(KEY, VALUE) \
SET_SYS(KEY, PyUnicode_FromWideChar(VALUE, -1));
- COPY_LIST("path", config->module_search_paths);
+ if (config->module_search_paths_set) {
+ COPY_LIST("path", config->module_search_paths);
+ }
SET_SYS_FROM_WSTR("executable", config->executable);
SET_SYS_FROM_WSTR("_base_executable", config->base_executable);