]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101819: Remove unused 'locale_module' from _io state (#104246)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Sat, 6 May 2023 20:26:06 +0000 (22:26 +0200)
committerGitHub <noreply@github.com>
Sat, 6 May 2023 20:26:06 +0000 (20:26 +0000)
The locale module reference was introduced by 932ff8368 in 2013,
and rendered unused by 710e82630 (gh-23050) in 2020.

Modules/_io/_iomodule.c
Modules/_io/_iomodule.h

index 403968af1b996caa437be5a64587ed3464bfd793..99b8a8e09ecf0a845bf38cf22f11661c7e7ea22a 100644 (file)
@@ -580,7 +580,6 @@ iomodule_traverse(PyObject *mod, visitproc visit, void *arg) {
     _PyIO_State *state = get_io_state(mod);
     if (!state->initialized)
         return 0;
-    Py_VISIT(state->locale_module);
     Py_VISIT(state->unsupported_operation);
 
     Py_VISIT(state->PyIncrementalNewlineDecoder_Type);
@@ -605,8 +604,6 @@ iomodule_clear(PyObject *mod) {
     _PyIO_State *state = get_io_state(mod);
     if (!state->initialized)
         return 0;
-    if (state->locale_module != NULL)
-        Py_CLEAR(state->locale_module);
     Py_CLEAR(state->unsupported_operation);
 
     Py_CLEAR(state->PyIncrementalNewlineDecoder_Type);
index 8a788fbb8185c568e50d984ab278cfa119c21b64..c971c987cf5fee517fd721703e1fc8db126754ce 100644 (file)
@@ -143,8 +143,6 @@ extern PyModuleDef _PyIO_Module;
 
 typedef struct {
     int initialized;
-    PyObject *locale_module;
-
     PyObject *unsupported_operation;
 
     /* Types */