mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
Issue #13722: Avoid silencing ImportErrors when initializing the codecs registry.
This commit is contained in:
parent
55f217f22d
commit
1b468af7be
2 changed files with 3 additions and 9 deletions
|
@ -103,6 +103,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
|
||||||
|
registry.
|
||||||
|
|
||||||
- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
|
- Issue #13781: Fix GzipFile bug that caused an exception to be raised when
|
||||||
opening for writing using a fileobj returned by os.fdopen().
|
opening for writing using a fileobj returned by os.fdopen().
|
||||||
|
|
||||||
|
|
|
@ -1067,15 +1067,6 @@ static int _PyCodecRegistry_Init(void)
|
||||||
|
|
||||||
mod = PyImport_ImportModuleNoBlock("encodings");
|
mod = PyImport_ImportModuleNoBlock("encodings");
|
||||||
if (mod == NULL) {
|
if (mod == NULL) {
|
||||||
if (PyErr_ExceptionMatches(PyExc_ImportError)) {
|
|
||||||
/* Ignore ImportErrors... this is done so that
|
|
||||||
distributions can disable the encodings package. Note
|
|
||||||
that other errors are not masked, e.g. SystemErrors
|
|
||||||
raised to inform the user of an error in the Python
|
|
||||||
configuration are still reported back to the user. */
|
|
||||||
PyErr_Clear();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_DECREF(mod);
|
Py_DECREF(mod);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue