mirror of
https://github.com/python/cpython.git
synced 2026-03-06 04:50:58 +00:00
[3.13] gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843) (GH-124853)
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".
(cherry picked from commit 60ff67d010)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
4a9a359f32
commit
970f3b73d2
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