From 0242f79051cd43343bafa797c2bfa9512f7be6c2 Mon Sep 17 00:00:00 2001 From: Berker Peksag Date: Fri, 22 Aug 2014 20:52:15 +0300 Subject: [PATCH] Issue #19447: Use importlib.util.cache_from_source() instead of ``bad_coding + 'c'``. Thanks to Arfrever Frehtes Taifersar Arahesis. --- Lib/test/test_py_compile.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py index 5edfafd96f3..640dcc3b079 100644 --- a/Lib/test/test_py_compile.py +++ b/Lib/test/test_py_compile.py @@ -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()