]> granicus.if.org Git - python/commitdiff
Fix the test to use an os.sep agnostic test. Hopefully this will fix the
authorBarry Warsaw <barry@python.org>
Tue, 2 Dec 2014 16:30:43 +0000 (11:30 -0500)
committerBarry Warsaw <barry@python.org>
Tue, 2 Dec 2014 16:30:43 +0000 (11:30 -0500)
Windows buildbots.  Found by Jeremy Kloth.

Lib/test/test_py_compile.py

index e99c3172776a350e14a2df47c89ef1c5a309f982..1abea278a2b087003f077a284f67f28a250762d2 100644 (file)
@@ -106,9 +106,13 @@ class PyCompileTests(unittest.TestCase):
         weird_path = os.path.join(self.directory, 'foo.bar.py')
         cache_path = importlib.util.cache_from_source(weird_path)
         pyc_path = weird_path + 'c'
+        head, tail = os.path.split(cache_path)
+        penultimate_tail = os.path.basename(head)
         self.assertEqual(
-            '/'.join(cache_path.split('/')[-2:]),
-            '__pycache__/foo.bar.{}.pyc'.format(sys.implementation.cache_tag))
+            os.path.join(penultimate_tail, tail),
+            os.path.join(
+                '__pycache__',
+                'foo.bar.{}.pyc'.format(sys.implementation.cache_tag)))
         with open(weird_path, 'w') as file:
             file.write('x = 123\n')
         py_compile.compile(weird_path)