summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-25 02:01:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-25 02:01:34 (GMT)
commit157c1263a2d0563ad9929ae13a28838d5d7e5cad (patch)
tree60c44dfd0b78f30a2485a40a36e0494fe9ffcf69 /Lib/importlib
parentabaf89b2be32db1deae32cbdf0645a4be65c6297 (diff)
parentdd21f68963c2b17324b6018dbbf1b32b6e88f2c2 (diff)
downloadcpython-157c1263a2d0563ad9929ae13a28838d5d7e5cad.zip
cpython-157c1263a2d0563ad9929ae13a28838d5d7e5cad.tar.gz
cpython-157c1263a2d0563ad9929ae13a28838d5d7e5cad.tar.bz2
Port remaining test fixes, and fix test_importlib too.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/test/source/test_file_loader.py10
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 e967e08..2ca57d0 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
@@ -131,7 +132,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.