diff options
author | Victor Stinner <vstinner@python.org> | 2024-09-04 10:58:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-04 10:58:32 (GMT) |
commit | b423ae6b0879ab1b53c6f517274c0d9e0f235d78 (patch) | |
tree | f43488fe34b2471309e36729343b80af55bf867e /Python/initconfig.c | |
parent | 7bd964dbbe301059f3971b1be281bee0938bc70a (diff) | |
download | cpython-b423ae6b0879ab1b53c6f517274c0d9e0f235d78.zip cpython-b423ae6b0879ab1b53c6f517274c0d9e0f235d78.tar.gz cpython-b423ae6b0879ab1b53c6f517274c0d9e0f235d78.tar.bz2 |
gh-107954, PEP 741: Adjust Python initialization config (#123663)
Setting dev_mode to 1 in an isolated configuration now enables also
faulthandler.
Moreover, setting "module_search_paths" option with
PyInitConfig_SetStrList() now sets "module_search_paths_set" to 1.
Diffstat (limited to 'Python/initconfig.c')
-rw-r--r-- | Python/initconfig.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Python/initconfig.c b/Python/initconfig.c index d2bb460..cc4b5b2 100644 --- a/Python/initconfig.c +++ b/Python/initconfig.c @@ -1031,7 +1031,6 @@ PyConfig_InitIsolatedConfig(PyConfig *config) config->dev_mode = 0; config->install_signal_handlers = 0; config->use_hash_seed = 0; - config->faulthandler = 0; config->tracemalloc = 0; config->perf_profiling = 0; config->int_max_str_digits = _PY_LONG_DEFAULT_MAX_STR_DIGITS; @@ -3753,7 +3752,7 @@ PyInitConfig_SetInt(PyInitConfig *config, const char *name, int64_t value) return -1; } - if (strcmp(name, "hash_seed")) { + if (strcmp(name, "hash_seed") == 0) { config->config.use_hash_seed = 1; } @@ -3863,7 +3862,14 @@ PyInitConfig_SetStrList(PyInitConfig *config, const char *name, return -1; } PyWideStringList *list = raw_member; - return _PyWideStringList_FromUTF8(config, list, length, items); + if (_PyWideStringList_FromUTF8(config, list, length, items) < 0) { + return -1; + } + + if (strcmp(name, "module_search_paths") == 0) { + config->config.module_search_paths_set = 1; + } + return 0; } |