From: Victor Stinner Date: Fri, 20 Mar 2015 12:48:36 +0000 (+0100) Subject: Issue #23696: Remove test on ZipImportError.__context__ because the context is X-Git-Tag: v3.5.0a3~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57d516bd6bfd1ae9a316c376bc72a96c4fa40c9f;p=thirdparty%2FPython%2Fcpython.git Issue #23696: Remove test on ZipImportError.__context__ because the context is None on Windows. When the file is not readable, the error occurs at open on UNIX. On Windows, the error only occurs at the first operation on the open file. It would require to many changes to set __context__ to an OSError for all file operations, for a little benefit (__context__ is almost never used). --- diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 5b8d77cae7b7..0a838417072e 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -453,7 +453,6 @@ class BadFileZipImportTestCase(unittest.TestCase): with self.assertRaises(zipimport.ZipImportError) as cm: zipimport.zipimporter(TESTMOD) - self.assertIsInstance(cm.exception.__context__, PermissionError) finally: # If we leave "the read-only bit" set on Windows, nothing can # delete TESTMOD, and later tests suffer bogus failures.