diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-16 19:48:51 +0200 |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-03-16 19:48:51 +0200 |
| commit | c28f6fa505f717698038b41492265129c77dfc0e (patch) | |
| tree | bad09c02133d9768950a6d79a53728232d8646a0 /Lib/test/test_imp.py | |
| parent | 58e1e50be1c19975cdff92f0670b9cff985b2308 (diff) | |
| download | cpython-git-c28f6fa505f717698038b41492265129c77dfc0e.tar.gz | |
#11420: make test suite pass with -B/DONTWRITEBYTECODE set. Initial patch by Thomas Wouters.
Diffstat (limited to 'Lib/test/test_imp.py')
| -rw-r--r-- | Lib/test/test_imp.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 551ad1b85c..5df8915399 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -153,9 +153,11 @@ class ImportTests(unittest.TestCase): mod = imp.load_source(temp_mod_name, temp_mod_name + '.py') self.assertEqual(mod.a, 1) - mod = imp.load_compiled( - temp_mod_name, imp.cache_from_source(temp_mod_name + '.py')) - self.assertEqual(mod.a, 1) + 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): os.mkdir(test_package_name) |
