summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-26 02:31:11 +0100
committerGitHub <noreply@github.com>2019-03-26 02:31:11 +0100
commit20004959d23d07ac784eef51ecb161012180faa8 (patch)
tree7fcc04b0924c2180d234196d3886e58cb57e2609 /Python/sysmodule.c
parentf78a5e9ce8f32a195f5f788aade79578437f30a6 (diff)
downloadcpython-git-20004959d23d07ac784eef51ecb161012180faa8.tar.gz
bpo-36301: Remove _PyCoreConfig.preconfig (GH-12546)
* Replace _PyCoreConfig.preconfig with 3 new fields in _PyCoreConfig: isolated, use_environment, dev_mode. * Add _PyPreCmdline.dev_mode. * Add _Py_PreInitializeFromPreConfigInPlace().
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 3df4d44a7c..12ec7d5918 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -2158,6 +2158,7 @@ make_flags(void)
{
int pos = 0;
PyObject *seq;
+ const _PyPreConfig *preconfig = &_PyRuntime.preconfig;
const _PyCoreConfig *config = &_PyInterpreterState_GET_UNSAFE()->core_config;
seq = PyStructSequence_New(&FlagsType);
@@ -2174,16 +2175,16 @@ make_flags(void)
SetFlag(!config->write_bytecode);
SetFlag(!config->user_site_directory);
SetFlag(!config->site_import);
- SetFlag(!config->preconfig.use_environment);
+ SetFlag(!config->use_environment);
SetFlag(config->verbose);
/* SetFlag(saw_unbuffered_flag); */
/* SetFlag(skipfirstline); */
SetFlag(config->bytes_warning);
SetFlag(config->quiet);
SetFlag(config->use_hash_seed == 0 || config->hash_seed != 0);
- SetFlag(config->preconfig.isolated);
- PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(config->preconfig.dev_mode));
- SetFlag(config->preconfig.utf8_mode);
+ SetFlag(config->isolated);
+ PyStructSequence_SET_ITEM(seq, pos++, PyBool_FromLong(config->dev_mode));
+ SetFlag(preconfig->utf8_mode);
#undef SetFlag
if (PyErr_Occurred()) {