]> granicus.if.org Git - python/commitdiff
Issue #19447: Use importlib.util.cache_from_source() instead of ``bad_coding + 'c'``.
authorBerker Peksag <berker.peksag@gmail.com>
Fri, 22 Aug 2014 17:52:15 +0000 (20:52 +0300)
committerBerker Peksag <berker.peksag@gmail.com>
Fri, 22 Aug 2014 17:52:15 +0000 (20:52 +0300)
Thanks to Arfrever Frehtes Taifersar Arahesis.

Lib/test/test_py_compile.py

index 5edfafd96f319e6bdbd1a5a255aa2659487d7d58..640dcc3b079d2af4cf1f6fc0b11ee62e57cadfc8 100644 (file)
@@ -95,7 +95,8 @@ class PyCompileTests(unittest.TestCase):
     def test_bad_coding(self):
         bad_coding = os.path.join(os.path.dirname(__file__), 'bad_coding2.py')
         self.assertIsNone(py_compile.compile(bad_coding, doraise=False))
-        self.assertFalse(os.path.exists(bad_coding + 'c'))
+        self.assertFalse(os.path.exists(
+            importlib.util.cache_from_source(bad_coding)))
 
 if __name__ == "__main__":
     unittest.main()