From f3cb81431574453aac3b6dcadb3120331e6a8f1c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 5 Nov 2020 18:12:33 +0100 Subject: 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(). --- Python/sysmodule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/sysmodule.c') diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 60b2494651..ae4f0eeb2e 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); -- cgit v1.2.1