Skip to content

Commit

Permalink
Create a pythonw.exe copy for free-threaded Windows builds
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Dec 6, 2024
1 parent a53a38b commit c5d2a04
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,8 +1221,10 @@ def build_cpython(
if freethreaded:
(major, minor, _) = python_version.split(".")
python_exe = f"python{major}.{minor}t.exe"
pythonw_exe = f"pythonw{major}.{minor}t.exe"
else:
python_exe = "python.exe"
pythonw_exe = "pythonw.exe"

if arch == "amd64":
build_platform = "x64"
Expand Down Expand Up @@ -1538,6 +1540,15 @@ def build_cpython(
canonical_python_exe,
)

# Create `pythonw.exe` copy when an alternative executable is built, e.g., when
# free-threading is enabled the name is `pythonw3.13t.exe`.
canonical_pythonw_exe = install_dir / "python.exe"
if not canonical_pythonw_exe.exists():
shutil.copy2(
install_dir / pythonw_exe,
canonical_pythonw_exe,
)

# CPython 3.13 removed `run_tests.py`, we provide a compatibility script
# for now.
if meets_python_minimum_version(python_version, "3.13"):
Expand Down

0 comments on commit c5d2a04

Please sign in to comment.