Skip to content

Commit 2500a69

Browse files
authored
Tests: In other_interpreter_exe, try python3 -> python3.Y (#103)
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
1 parent 254cd43 commit 2500a69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/test_tox_uv_venv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ def other_interpreter_exe() -> pathlib.Path: # pragma: no cover
6262

6363
exe = pathlib.Path(sys.executable)
6464
base_python: pathlib.Path | None = None
65-
if exe.name == "python":
65+
if exe.name in {"python", "python3"}:
6666
# python -> pythonX.Y
6767
ver = sys.version_info
6868
base_python = exe.with_name(f"python{ver.major}.{ver.minor}")
6969
elif exe.name[-1].isdigit():
70-
# python X[.Y] -> python
70+
# python X.Y -> python
7171
base_python = exe.with_name(exe.stem[:-1])
7272
elif exe.suffix == ".exe":
7373
# python.exe <-> pythonw.exe

0 commit comments

Comments
 (0)