diff options
author | Brett Cannon <bcannon@gmail.com> | 2010-06-28 04:57:24 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2010-06-28 04:57:24 (GMT) |
commit | 0cf9e6a6214d4418286a30e305fefad644b29c52 (patch) | |
tree | 9d07df67286fe14593baeae5ce2d0f1bd3b555db /Lib/importlib/test | |
parent | 9396483ba40888b735b3d00dc5f1d1379f939914 (diff) | |
download | cpython-0cf9e6a6214d4418286a30e305fefad644b29c52.zip cpython-0cf9e6a6214d4418286a30e305fefad644b29c52.tar.gz cpython-0cf9e6a6214d4418286a30e305fefad644b29c52.tar.bz2 |
Move importlib.abc.SourceLoader to _bootstrap.
Required updating code relying on other modules to switch to _bootstrap's
unique module requirements. This led to the realization that
get_code was being too liberal in its exception catching when calling set_data
by blindly grabbing IOError. Shifted the responsibility of safely ignoring
writes to a read-only path to set_data.
Importlib is still not relying on SourceLoader yet; requires creating a
SourcelessLoader and updating the source finder.
Diffstat (limited to 'Lib/importlib/test')
-rw-r--r-- | Lib/importlib/test/source/test_abc_loader.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/importlib/test/source/test_abc_loader.py b/Lib/importlib/test/source/test_abc_loader.py index 62729b4..6bdaadb 100644 --- a/Lib/importlib/test/source/test_abc_loader.py +++ b/Lib/importlib/test/source/test_abc_loader.py @@ -748,10 +748,9 @@ class SourceLoaderBytecodeTests(SourceLoaderTestHarness): return closure self.setUp(magic=b'0000') - for exc in (NotImplementedError, IOError): - self.loader.set_data = raise_exception(exc) - code_object = self.loader.get_code(self.name) - self.verify_code(code_object) + self.loader.set_data = raise_exception(NotImplementedError) + code_object = self.loader.get_code(self.name) + self.verify_code(code_object) class AbstractMethodImplTests(unittest.TestCase): |