diff options
Diffstat (limited to 'Lib/test/test_imp.py')
| -rw-r--r-- | Lib/test/test_imp.py | 6 | 
1 files changed, 4 insertions, 2 deletions
| diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 65c9f25c83..72ae145f68 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): | 
