diff options
author | Victor Stinner <vstinner@redhat.com> | 2018-09-17 22:13:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-17 22:13:17 (GMT) |
commit | 188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27 (patch) | |
tree | c13681a2bbd98f90055dd18e26cf9ceea2a8b40d /Python/coreconfig.c | |
parent | c62ab2862db2382808bb2228760eebdda3f608bd (diff) | |
download | cpython-188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27.zip cpython-188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27.tar.gz cpython-188ebfa475a6f6aa2d0ea14ca8e1fbe7865b6d27.tar.bz2 |
bpo-34589: Make _PyCoreConfig.coerce_c_locale private (GH-9371)
_PyCoreConfig:
* Rename coerce_c_locale to _coerce_c_locale
* Rename coerce_c_locale_warn to _coerce_c_locale_warn
These fields are now private (name prefixed by "_").
Diffstat (limited to 'Python/coreconfig.c')
-rw-r--r-- | Python/coreconfig.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Python/coreconfig.c b/Python/coreconfig.c index fae32e5..1e03ce3 100644 --- a/Python/coreconfig.c +++ b/Python/coreconfig.c @@ -303,8 +303,8 @@ _PyCoreConfig_Copy(_PyCoreConfig *config, const _PyCoreConfig *config2) COPY_ATTR(dump_refs); COPY_ATTR(malloc_stats); - COPY_ATTR(coerce_c_locale); - COPY_ATTR(coerce_c_locale_warn); + COPY_ATTR(_coerce_c_locale); + COPY_ATTR(_coerce_c_locale_warn); COPY_ATTR(utf8_mode); COPY_WSTR_ATTR(pycache_prefix); @@ -811,16 +811,16 @@ config_read_env_vars(_PyCoreConfig *config) const char *env = _PyCoreConfig_GetEnv(config, "PYTHONCOERCECLOCALE"); if (env) { if (strcmp(env, "0") == 0) { - if (config->coerce_c_locale < 0) { - config->coerce_c_locale = 0; + if (config->_coerce_c_locale < 0) { + config->_coerce_c_locale = 0; } } else if (strcmp(env, "warn") == 0) { - config->coerce_c_locale_warn = 1; + config->_coerce_c_locale_warn = 1; } else { - if (config->coerce_c_locale < 0) { - config->coerce_c_locale = 1; + if (config->_coerce_c_locale < 0) { + config->_coerce_c_locale = 1; } } } @@ -967,10 +967,10 @@ config_read_complex_options(_PyCoreConfig *config) static void config_init_locale(_PyCoreConfig *config) { - if (config->coerce_c_locale < 0) { + if (config->_coerce_c_locale < 0) { /* The C locale enables the C locale coercion (PEP 538) */ if (_Py_LegacyLocaleDetected()) { - config->coerce_c_locale = 1; + config->_coerce_c_locale = 1; } } @@ -1291,7 +1291,7 @@ _PyCoreConfig_Read(_PyCoreConfig *config) } } - if (config->utf8_mode < 0 || config->coerce_c_locale < 0) { + if (config->utf8_mode < 0 || config->_coerce_c_locale < 0) { config_init_locale(config); } @@ -1321,8 +1321,8 @@ _PyCoreConfig_Read(_PyCoreConfig *config) if (config->tracemalloc < 0) { config->tracemalloc = 0; } - if (config->coerce_c_locale < 0) { - config->coerce_c_locale = 0; + if (config->_coerce_c_locale < 0) { + config->_coerce_c_locale = 0; } if (config->utf8_mode < 0) { config->utf8_mode = 0; @@ -1343,7 +1343,7 @@ _PyCoreConfig_Read(_PyCoreConfig *config) return err; } - assert(config->coerce_c_locale >= 0); + assert(config->_coerce_c_locale >= 0); assert(config->use_environment >= 0); assert(config->filesystem_encoding != NULL); assert(config->filesystem_errors != NULL); |