diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-09-23 13:59:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-23 13:59:00 (GMT) |
commit | c5c642565e260477ae2fb29d0c86a91e19702ae3 (patch) | |
tree | b0ff8adcdf73332394a51288b3c9cef7373a9117 /Python/pylifecycle.c | |
parent | fe9089a08b6dd6dd1ba8b238afc2fc4dfaac689e (diff) | |
download | cpython-c5c642565e260477ae2fb29d0c86a91e19702ae3.zip cpython-c5c642565e260477ae2fb29d0c86a91e19702ae3.tar.gz cpython-c5c642565e260477ae2fb29d0c86a91e19702ae3.tar.bz2 |
bpo-38236: Dump path config at first import error (GH-16300) (GH-16332)
Python now dumps path configuration if it fails to import the Python
codecs of the filesystem and stdio encodings.
(cherry picked from commit fcdb027234566c4d506d6d753c7d5638490fb088)
Diffstat (limited to 'Python/pylifecycle.c')
-rw-r--r-- | Python/pylifecycle.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index a9a6589..4d7873f 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -941,7 +941,8 @@ pyinit_main(_PyRuntimeState *runtime, PyInterpreterState *interp) return status; } - status = _PyUnicode_InitEncodings(interp); + PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime); + status = _PyUnicode_InitEncodings(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } @@ -1508,7 +1509,7 @@ new_interpreter(PyThreadState **tstate_p) return status; } - status = _PyUnicode_InitEncodings(interp); + status = _PyUnicode_InitEncodings(tstate); if (_PyStatus_EXCEPTION(status)) { return status; } |