From abeaaba96716854467ea147676bf0c6099ae224b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 9 Oct 2024 16:39:20 +0200 Subject: [PATCH] Tests: In other_interpreter_exe, try python3 -> python3.Y The "python" executable exists only if "python3" exists, but "python3" can exist without "python". This is at least the case in Fedora, following https://peps.python.org/pep-0394/#for-python-runtime-distributors --- tests/test_tox_uv_venv.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_tox_uv_venv.py b/tests/test_tox_uv_venv.py index edb525c..84b2ed2 100644 --- a/tests/test_tox_uv_venv.py +++ b/tests/test_tox_uv_venv.py @@ -62,12 +62,12 @@ def other_interpreter_exe() -> pathlib.Path: # pragma: no cover exe = pathlib.Path(sys.executable) base_python: pathlib.Path | None = None - if exe.name == "python": + if exe.name == "python" or exe.name == "python3": # python -> pythonX.Y ver = sys.version_info base_python = exe.with_name(f"python{ver.major}.{ver.minor}") elif exe.name[-1].isdigit(): - # python X[.Y] -> python + # python X.Y -> python base_python = exe.with_name(exe.stem[:-1]) elif exe.suffix == ".exe": # python.exe <-> pythonw.exe