Commit d145775b authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-34170: Cleanup pymain_read_conf() (GH-8476)

* Config: Rename ignore_environment field to use_environment.
* _PyCoreConfig_Read(): if isolated is set, use_environment and
  site_import are now always set to 0.
* Inline pymain_free_raw() into pymain_free()
* Move config_init_warnoptions() call into pymain_read_conf_impl()
* _PyCoreConfig_Read(): don't replace values if they are already set:
  faulthandler, pycache_prefix, home.
parent 5473f061
......@@ -29,9 +29,14 @@ typedef struct {
/* Install signal handlers? Yes by default. */
int install_signal_handlers;
int ignore_environment; /* -E, Py_IgnoreEnvironmentFlag, -1 means unset */
/* If greater than 0: use environment variables.
Set to 0 by -E command line option. If set to -1 (default), it is
set to !Py_IgnoreEnvironmentFlag. */
int use_environment;
int use_hash_seed; /* PYTHONHASHSEED=x */
unsigned long hash_seed;
const char *allocator; /* Memory allocator: PYTHONMALLOC */
int dev_mode; /* PYTHONDEVMODE, -X dev */
......@@ -238,7 +243,7 @@ typedef struct {
#define _PyCoreConfig_INIT \
(_PyCoreConfig){ \
.install_signal_handlers = 1, \
.ignore_environment = -1, \
.use_environment = -1, \
.use_hash_seed = -1, \
.faulthandler = -1, \
.tracemalloc = -1, \
......
This diff is collapsed.
......@@ -77,7 +77,7 @@ main(int argc, char *argv[])
_PyCoreConfig config = _PyCoreConfig_INIT;
config.user_site_directory = 0;
config.site_import = 0;
config.ignore_environment = 1;
config.use_environment = 0;
config.program_name = L"./_freeze_importlib";
/* Don't install importlib, since it could execute outdated bytecode. */
config._install_importlib = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment