summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-17 23:11:46 (GMT)
committerGitHub <noreply@github.com>2020-06-17 23:11:46 (GMT)
commit1bf7959dce0597e312c6f35476a7cc957fd0323c (patch)
tree627f5b3021d83ee6f08f694618356b2341fdc3a9 /Python
parent4c18fc8f1def7030e5ec5d1ffb9355d7453dc408 (diff)
downloadcpython-1bf7959dce0597e312c6f35476a7cc957fd0323c.zip
cpython-1bf7959dce0597e312c6f35476a7cc957fd0323c.tar.gz
cpython-1bf7959dce0597e312c6f35476a7cc957fd0323c.tar.bz2
bpo-41006: Remove init_sys_streams() hack (GH-20954)
The encodings.latin_1 module is no longer imported at startup. Now it is only imported when it is the filesystem encoding or the stdio encoding.
Diffstat (limited to 'Python')
-rw-r--r--Python/pylifecycle.c13
1 files changed, 0 insertions, 13 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c
index c754f21..87f25e6 100644
--- a/Python/pylifecycle.c
+++ b/Python/pylifecycle.c
@@ -1939,7 +1939,6 @@ static PyStatus
init_sys_streams(PyThreadState *tstate)
{
PyObject *iomod = NULL;
- PyObject *m;
PyObject *std = NULL;
int fd;
PyObject * encoding_attr;
@@ -1959,18 +1958,6 @@ init_sys_streams(PyThreadState *tstate)
}
#endif
- /* Hack to avoid a nasty recursion issue when Python is invoked
- in verbose mode: pre-import the Latin-1 and UTF-8 codecs */
- if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) {
- goto error;
- }
- Py_DECREF(m);
-
- if (!(m = PyImport_ImportModule("encodings.latin_1"))) {
- goto error;
- }
- Py_DECREF(m);
-
if (!(iomod = PyImport_ImportModule("io"))) {
goto error;
}