]> granicus.if.org Git - python/commitdiff
Issue #13722: Avoid silencing ImportErrors when initializing the codecs registry.
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 18 Jan 2012 21:30:21 +0000 (22:30 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 18 Jan 2012 21:30:21 +0000 (22:30 +0100)
Misc/NEWS
Python/codecs.c

index d6728be60bce9353f4465ba3211d0e5d11880a81..7d8cb7b40f815342ee8b9ce9593fc4b3911e16e1 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -103,6 +103,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #13722: Avoid silencing ImportErrors when initializing the codecs
+  registry.
+
 - Issue #13781: Fix GzipFile bug that caused an exception to be raised when
   opening for writing using a fileobj returned by os.fdopen().
 
index 1a3e45774cb8f7c9e45606070d2caa5ad19fd1b2..c7f4a9cbc1a43f62aa938212857dce72f62fe416 100644 (file)
@@ -1067,15 +1067,6 @@ static int _PyCodecRegistry_Init(void)
 
     mod = PyImport_ImportModuleNoBlock("encodings");
     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;
     }
     Py_DECREF(mod);