diff options
author | Victor Stinner <vstinner@python.org> | 2020-10-31 00:02:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-31 00:02:09 (GMT) |
commit | 710e82630775774dceba5e8f24b1b10e6dfaf9b7 (patch) | |
tree | b4415da3ed5f8bc2ad2a52ec9a8544b9e50d975f /Modules/_io/_iomodule.c | |
parent | 06f8c3328dcd81c84d1ee2b3a57b5381dcb38482 (diff) | |
download | cpython-710e82630775774dceba5e8f24b1b10e6dfaf9b7.zip cpython-710e82630775774dceba5e8f24b1b10e6dfaf9b7.tar.gz cpython-710e82630775774dceba5e8f24b1b10e6dfaf9b7.tar.bz2 |
bpo-42208: Add _Py_GetLocaleEncoding() (GH-23050)
_io.TextIOWrapper no longer calls getpreferredencoding(False) of
_bootlocale to get the locale encoding, but calls
_Py_GetLocaleEncoding() instead.
Add config_get_fs_encoding() sub-function. Reorganize also
config_get_locale_encoding() code.
Diffstat (limited to 'Modules/_io/_iomodule.c')
-rw-r--r-- | Modules/_io/_iomodule.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Modules/_io/_iomodule.c b/Modules/_io/_iomodule.c index e430352..9147648 100644 --- a/Modules/_io/_iomodule.c +++ b/Modules/_io/_iomodule.c @@ -593,31 +593,6 @@ _PyIO_get_module_state(void) return state; } -PyObject * -_PyIO_get_locale_module(_PyIO_State *state) -{ - PyObject *mod; - if (state->locale_module != NULL) { - assert(PyWeakref_CheckRef(state->locale_module)); - mod = PyWeakref_GET_OBJECT(state->locale_module); - if (mod != Py_None) { - Py_INCREF(mod); - return mod; - } - Py_CLEAR(state->locale_module); - } - mod = PyImport_ImportModule("_bootlocale"); - if (mod == NULL) - return NULL; - state->locale_module = PyWeakref_NewRef(mod, NULL); - if (state->locale_module == NULL) { - Py_DECREF(mod); - return NULL; - } - return mod; -} - - static int iomodule_traverse(PyObject *mod, visitproc visit, void *arg) { _PyIO_State *state = get_io_state(mod); |