summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
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):