summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-16 19:50:04 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-16 19:50:04 (GMT)
commit469da97c1e7b1a36771ed6fe819473ba81569422 (patch)
tree3ef7b602007ddd6e0d8d5fe48ac9a03d5e29a14e /Lib/test/test_imp.py
parent2d6acd2ac2399ecc0f163c12c5695f434ba14955 (diff)
parente5e7a7cbf450f80fa9a88038878b6bd525313f37 (diff)
downloadcpython-469da97c1e7b1a36771ed6fe819473ba81569422.zip
cpython-469da97c1e7b1a36771ed6fe819473ba81569422.tar.gz
cpython-469da97c1e7b1a36771ed6fe819473ba81569422.tar.bz2
#11420: merge with 3.3.
Diffstat (limited to 'Lib/test/test_imp.py')
-rw-r--r--Lib/test/test_imp.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 52c4399..2d75724 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -162,8 +162,10 @@ class ImportTests(unittest.TestCase):
with warnings.catch_warnings():
warnings.simplefilter('ignore')
- mod = imp.load_compiled(
- temp_mod_name, imp.cache_from_source(temp_mod_name + '.py'))
+ if not sys.dont_write_bytecode:
+ mod = imp.load_compiled(
+ temp_mod_name,
+ imp.cache_from_source(temp_mod_name + '.py'))
self.assertEqual(mod.a, 1)
if not os.path.exists(test_package_name):