[Python-checkins] cpython (3.4): Fix the test to use an os.sep agnostic test. Hopefully this will fix the
barry.warsaw
python-checkins at python.org
Tue Dec 2 17:31:52 CET 2014
https://hg.python.org/cpython/rev/4e9c495235d9
changeset: 93700:4e9c495235d9
branch: 3.4
parent: 93698:8badbd65840e
user: Barry Warsaw <barry at python.org>
date: Tue Dec 02 11:30:43 2014 -0500
summary:
Fix the test to use an os.sep agnostic test. Hopefully this will fix the
Windows buildbots. Found by Jeremy Kloth.
files:
Lib/test/test_py_compile.py | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py
--- a/Lib/test/test_py_compile.py
+++ b/Lib/test/test_py_compile.py
@@ -106,9 +106,13 @@
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)
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list