summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_imp.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-03-16 19:49:20 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-03-16 19:49:20 (GMT)
commite5e7a7cbf450f80fa9a88038878b6bd525313f37 (patch)
tree02534825505cbbe06aa12dfda5386330a0d67605 /Lib/test/test_imp.py
parente3eb0615af1389f221cb617de71fe9bb42bb7769 (diff)
parentc28f6fa505f717698038b41492265129c77dfc0e (diff)
downloadcpython-e5e7a7cbf450f80fa9a88038878b6bd525313f37.zip
cpython-e5e7a7cbf450f80fa9a88038878b6bd525313f37.tar.gz
cpython-e5e7a7cbf450f80fa9a88038878b6bd525313f37.tar.bz2
#11420: merge with 3.2.
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 65c9f25..72ae145 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):