https://github.com/python/cpython/commit/79746b31ff1c2658d5f3fb3ce68e12733cf837d4 commit: 79746b31ff1c2658d5f3fb3ce68e12733cf837d4 branch: 3.12 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2024-10-01T16:22:05Z summary:
[3.12] gh-124842: Fix test.support.import_helper.make_legacy_pyc() (GH-124843) (GH-124854) 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 60ff67d010078eca15a74b1429caf779ac4f9c74) Co-authored-by: Serhiy Storchaka <[email protected]> files: M Lib/test/support/import_helper.py diff --git a/Lib/test/support/import_helper.py b/Lib/test/support/import_helper.py index 29c6f535b40342..bb957046364bd4 100644 --- a/Lib/test/support/import_helper.py +++ b/Lib/test/support/import_helper.py @@ -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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
