diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-07-24 11:55:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 11:55:48 (GMT) |
commit | d19d8d5279f156bc8f6736b5f16f069879b9519b (patch) | |
tree | dc3c2561371a0be4410172fe4270a37ab7c76ba6 /Python/pathconfig.c | |
parent | ac0b3c2f4d86fc056b833a4e6b9a380741244a63 (diff) | |
download | cpython-d19d8d5279f156bc8f6736b5f16f069879b9519b.zip cpython-d19d8d5279f156bc8f6736b5f16f069879b9519b.tar.gz cpython-d19d8d5279f156bc8f6736b5f16f069879b9519b.tar.bz2 |
bpo-34170: Add _PyCoreConfig.isolated (GH-8417)
* _PyCoreConfig: add isolated and site_import attributes
* Replace Py_IgnoreEnvironment with config->ignore_environment when
reading the current configuration
* _PyCoreConfig_Read() now sets ignore_environment, utf8_mode,
isolated and site_import from Py_IgnoreEnvironment, Py_UTF8Mode,
Py_IsolatedFlag and Py_NoSiteFlag
* _Py_InitializeCore() now sets Py_xxx flags from the configuration
* pymain_read_conf() now uses _PyCoreConfig_Copy() to save/restore
the configuration.
* Rename _disable_importlib of _PyCoreConfig to _install_importlib
* _PyCoreConfig_SetGlobalConfig() now also set
Py_HashRandomizationFlag
* Replace !Py_NoSiteFlag with core_config->site_import
Diffstat (limited to 'Python/pathconfig.c')
-rw-r--r-- | Python/pathconfig.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c index 1f6177f..509ea8e 100644 --- a/Python/pathconfig.c +++ b/Python/pathconfig.c @@ -283,8 +283,7 @@ core_config_init_module_search_paths(_PyCoreConfig *config, _PyInitError -_PyCoreConfig_InitPathConfig(_PyCoreConfig *config, - int *isolated, int *no_site_import) +_PyCoreConfig_InitPathConfig(_PyCoreConfig *config) { _PyPathConfig path_config = _PyPathConfig_INIT; _PyInitError err; @@ -345,11 +344,11 @@ _PyCoreConfig_InitPathConfig(_PyCoreConfig *config, } } - if (path_config.isolated != -1 && isolated != NULL) { - *isolated = path_config.isolated; + if (path_config.isolated != -1) { + config->isolated = path_config.isolated; } - if (path_config.no_site_import != -1 && no_site_import != NULL) { - *no_site_import = path_config.no_site_import; + if (path_config.site_import != -1) { + config->site_import = path_config.site_import; } _PyPathConfig_Clear(&path_config); @@ -375,10 +374,7 @@ pathconfig_global_init(void) _PyInitError err; _PyCoreConfig config = _PyCoreConfig_INIT; - /* Py_IsolatedFlag and Py_NoSiteFlag are left unchanged: pass NULL. - _PyCoreConfig_InitPathConfig() will be called later and will set - these flags. */ - err = _PyCoreConfig_Read(&config, NULL, NULL); + err = _PyCoreConfig_Read(&config); if (_Py_INIT_FAILED(err)) { goto error; } |