diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-25 03:00:57 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-25 03:00:57 +0100 |
commit | dd21f68963c2b17324b6018dbbf1b32b6e88f2c2 (patch) | |
tree | d29ddbed1e580054967d84495ee5f624568080d2 /Lib/importlib/test/source/test_file_loader.py | |
parent | 05f29b7a3aabc89000cce21d7bfec368f9ba5a26 (diff) | |
download | cpython-git-dd21f68963c2b17324b6018dbbf1b32b6e88f2c2.tar.gz |
Port remaining test fixes, and fix test_importlib too.
Diffstat (limited to 'Lib/importlib/test/source/test_file_loader.py')
-rw-r--r-- | Lib/importlib/test/source/test_file_loader.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/importlib/test/source/test_file_loader.py b/Lib/importlib/test/source/test_file_loader.py index 89990be9da..912e6c3b51 100644 --- a/Lib/importlib/test/source/test_file_loader.py +++ b/Lib/importlib/test/source/test_file_loader.py @@ -4,6 +4,7 @@ from .. import abc from .. import util from . import util as source_util +import errno import imp import marshal import os @@ -136,7 +137,14 @@ class SimpleTest(unittest.TestCase): compiled = imp.cache_from_source(source) with open(source, 'w') as f: f.write("x = 5") - os.utime(source, (2 ** 33, 2 ** 33)) + try: + os.utime(source, (2 ** 33, 2 ** 33)) + except OverflowError: + self.skipTest("cannot set modification time to large integer") + except OSError as e: + if e.errno != getattr(errno, 'EOVERFLOW', None): + raise + self.skipTest("cannot set modification time to large integer ({})".format(e)) loader = _bootstrap._SourceFileLoader('_temp', mapping['_temp']) mod = loader.load_module('_temp') # Sanity checks. |