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.
diff --git a/Include/pystate.h b/Include/pystate.h
index f59d26b..a35fc89 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -29,9 +29,14 @@
/* 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 @@
#define _PyCoreConfig_INIT \
(_PyCoreConfig){ \
.install_signal_handlers = 1, \
- .ignore_environment = -1, \
+ .use_environment = -1, \
.use_hash_seed = -1, \
.faulthandler = -1, \
.tracemalloc = -1, \