summaryrefslogtreecommitdiff
path: root/Python/coreconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/coreconfig.c')
-rw-r--r--Python/coreconfig.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Python/coreconfig.c b/Python/coreconfig.c
index 1e03ce31f3..131a043ff2 100644
--- a/Python/coreconfig.c
+++ b/Python/coreconfig.c
@@ -816,7 +816,9 @@ config_read_env_vars(_PyCoreConfig *config)
}
}
else if (strcmp(env, "warn") == 0) {
- config->_coerce_c_locale_warn = 1;
+ if (config->_coerce_c_locale_warn < 0) {
+ config->_coerce_c_locale_warn = 1;
+ }
}
else {
if (config->_coerce_c_locale < 0) {
@@ -1324,6 +1326,9 @@ _PyCoreConfig_Read(_PyCoreConfig *config)
if (config->_coerce_c_locale < 0) {
config->_coerce_c_locale = 0;
}
+ if (config->_coerce_c_locale_warn < 0) {
+ config->_coerce_c_locale_warn = 0;
+ }
if (config->utf8_mode < 0) {
config->utf8_mode = 0;
}