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 /Modules | |
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 'Modules')
-rw-r--r-- | Modules/_testcapimodule.c | 8 | ||||
-rw-r--r-- | Modules/main.c | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index add642f..c21a6e3 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -4701,10 +4701,6 @@ get_coreconfig(PyObject *self, PyObject *Py_UNUSED(args)) PyLong_FromLong(config->dump_refs)); SET_ITEM("malloc_stats", PyLong_FromLong(config->malloc_stats)); - SET_ITEM("coerce_c_locale", - PyLong_FromLong(config->coerce_c_locale)); - SET_ITEM("coerce_c_locale_warn", - PyLong_FromLong(config->coerce_c_locale_warn)); SET_ITEM("filesystem_encoding", FROM_STRING(config->filesystem_encoding)); SET_ITEM("filesystem_errors", @@ -4783,6 +4779,10 @@ get_coreconfig(PyObject *self, PyObject *Py_UNUSED(args)) FROM_STRING(config->_check_hash_pycs_mode)); SET_ITEM("_frozen", PyLong_FromLong(config->_frozen)); + SET_ITEM("_coerce_c_locale", + PyLong_FromLong(config->_coerce_c_locale)); + SET_ITEM("_coerce_c_locale_warn", + PyLong_FromLong(config->_coerce_c_locale_warn)); return dict; diff --git a/Modules/main.c b/Modules/main.c index 455178a..6bc2917 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -1342,9 +1342,9 @@ pymain_read_conf(_PyMain *pymain, _PyCoreConfig *config, * See the documentation of the PYTHONCOERCECLOCALE setting for more * details. */ - if (config->coerce_c_locale && !locale_coerced) { + if (config->_coerce_c_locale && !locale_coerced) { locale_coerced = 1; - _Py_CoerceLegacyLocale(config->coerce_c_locale_warn); + _Py_CoerceLegacyLocale(config->_coerce_c_locale_warn); encoding_changed = 1; } @@ -1367,7 +1367,7 @@ pymain_read_conf(_PyMain *pymain, _PyCoreConfig *config, /* Reset the configuration before reading again the configuration, just keep UTF-8 Mode value. */ int new_utf8_mode = config->utf8_mode; - int new_coerce_c_locale = config->coerce_c_locale; + int new_coerce_c_locale = config->_coerce_c_locale; if (_PyCoreConfig_Copy(config, &save_config) < 0) { pymain->err = _Py_INIT_NO_MEMORY(); goto done; @@ -1375,7 +1375,7 @@ pymain_read_conf(_PyMain *pymain, _PyCoreConfig *config, pymain_clear_cmdline(pymain, cmdline); memset(cmdline, 0, sizeof(*cmdline)); config->utf8_mode = new_utf8_mode; - config->coerce_c_locale = new_coerce_c_locale; + config->_coerce_c_locale = new_coerce_c_locale; /* The encoding changed: read again the configuration with the new encoding */ |