[Python-checkins] cpython: Issue #23696: Remove test on ZipImportError.__context__ because the context is

victor.stinner python-checkins at python.org
Fri Mar 20 13:52:17 CET 2015


https://hg.python.org/cpython/rev/022d64b503b8
changeset:   95095:022d64b503b8
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Mar 20 13:48:36 2015 +0100
summary:
  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).

files:
  Lib/test/test_zipimport.py |  1 -
  1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -453,7 +453,6 @@
 
             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.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list