mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843)
For source file "path/to/file.py" it created file with incorrect path "/absolute/path/to/path/to/file.pyc" instead of "path/to/file.pyc".
This commit is contained in:
parent
da1e5526ae
commit
60ff67d010
1 changed files with 2 additions and 2 deletions
|
@ -58,8 +58,8 @@ def make_legacy_pyc(source):
|
|||
:return: The file system path to the legacy pyc file.
|
||||
"""
|
||||
pyc_file = importlib.util.cache_from_source(source)
|
||||
up_one = os.path.dirname(os.path.abspath(source))
|
||||
legacy_pyc = os.path.join(up_one, source + 'c')
|
||||
assert source.endswith('.py')
|
||||
legacy_pyc = source + 'c'
|
||||
shutil.move(pyc_file, legacy_pyc)
|
||||
return legacy_pyc
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue