summaryrefslogtreecommitdiffstats
path: root/Programs
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-05 01:01:27 (GMT)
committerGitHub <noreply@github.com>2019-03-05 01:01:27 (GMT)
commitcad1f747da47849ab5d8b0b881f7a0b94564d290 (patch)
treeb66ed4ec4f2f26c08fde4989fbf2be680834973d /Programs
parent7e9ce4c89e9a34ff84a89831812bc8b42d37ac1f (diff)
downloadcpython-cad1f747da47849ab5d8b0b881f7a0b94564d290.zip
cpython-cad1f747da47849ab5d8b0b881f7a0b94564d290.tar.gz
cpython-cad1f747da47849ab5d8b0b881f7a0b94564d290.tar.bz2
bpo-36142: Add _PyPreConfig structure (GH-12172)
* Add _PyPreConfig structure * Move 'ignored' and 'use_environment' fields from _PyCoreConfig to _PyPreConfig * Add a new "_PyPreConfig preconfig;" field to _PyCoreConfig
Diffstat (limited to 'Programs')
-rw-r--r--Programs/_freeze_importlib.c2
-rw-r--r--Programs/_testembed.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/Programs/_freeze_importlib.c b/Programs/_freeze_importlib.c
index d0e40c9..e6c51a4 100644
--- a/Programs/_freeze_importlib.c
+++ b/Programs/_freeze_importlib.c
@@ -77,9 +77,9 @@ main(int argc, char *argv[])
text[text_size] = '\0';
_PyCoreConfig config = _PyCoreConfig_INIT;
+ config.preconfig.use_environment = 0;
config.user_site_directory = 0;
config.site_import = 0;
- config.use_environment = 0;
config.program_name = L"./_freeze_importlib";
/* Don't install importlib, since it could execute outdated bytecode. */
config._install_importlib = 0;
diff --git a/Programs/_testembed.c b/Programs/_testembed.c
index 6b5311b..7b4d8c2 100644
--- a/Programs/_testembed.c
+++ b/Programs/_testembed.c
@@ -606,15 +606,15 @@ static int test_init_isolated(void)
/* Test _PyCoreConfig.isolated=1 */
_PyCoreConfig config = _PyCoreConfig_INIT;
+ Py_IsolatedFlag = 0;
+ config.preconfig.isolated = 1;
+
/* Set coerce_c_locale and utf8_mode to not depend on the locale */
config.coerce_c_locale = 0;
config.utf8_mode = 0;
/* Use path starting with "./" avoids a search along the PATH */
config.program_name = L"./_testembed";
- Py_IsolatedFlag = 0;
- config.isolated = 1;
-
test_init_env_putenvs();
_PyInitError err = _Py_InitializeFromConfig(&config);
if (_Py_INIT_FAILED(err)) {