Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changelog/2774.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure python3.exe and python3 on Windows for Python 3. - by :user:`esafak`.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def _executables(cls, interpreter):
# - https://bugs.python.org/issue42013
# - venv
host = cls.host_python(interpreter)
for path in (host.parent / n for n in {"python.exe", host.name}):
names = {"python.exe", host.name}
if interpreter.version_info.major == 3: # noqa: PLR2004
names.update({"python3.exe", "python3"})
for path in (host.parent / n for n in names):
yield host, [path.name], RefMust.COPY, RefWhen.ANY
# for more info on pythonw.exe see https://stackoverflow.com/a/30313091
python_w = host.parent / "pythonw.exe"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,11 @@ def test_no_python_zip_if_not_exists(py_info, mock_files):
sources = tuple(CPython3Windows.sources(interpreter=py_info))
assert python_zip in py_info.path
assert not contains_ref(sources, python_zip)


@pytest.mark.parametrize("py_info_name", ["cpython3_win_embed"])
def test_python3_exe_present(py_info, mock_files):
mock_files(CPYTHON3_PATH, [py_info.system_executable])
sources = tuple(CPython3Windows.sources(interpreter=py_info))
assert contains_exe(sources, py_info.system_executable, "python3.exe")
assert contains_exe(sources, py_info.system_executable, "python3")
Loading