@@ -1221,8 +1221,10 @@ def build_cpython(
1221
1221
if freethreaded :
1222
1222
(major , minor , _ ) = python_version .split ("." )
1223
1223
python_exe = f"python{ major } .{ minor } t.exe"
1224
+ pythonw_exe = f"pythonw{ major } .{ minor } t.exe"
1224
1225
else :
1225
1226
python_exe = "python.exe"
1227
+ pythonw_exe = "pythonw.exe"
1226
1228
1227
1229
if arch == "amd64" :
1228
1230
build_platform = "x64"
@@ -1529,7 +1531,7 @@ def build_cpython(
1529
1531
log ("copying %s to %s" % (source , dest ))
1530
1532
shutil .copyfile (source , dest )
1531
1533
1532
- # Rename to `python.exe` when an alternative executable is built, e.g., when
1534
+ # Create a `python.exe` copy when an alternative executable is built, e.g., when
1533
1535
# free-threading is enabled the name is `python3.13t.exe`.
1534
1536
canonical_python_exe = install_dir / "python.exe"
1535
1537
if not canonical_python_exe .exists ():
@@ -1538,6 +1540,15 @@ def build_cpython(
1538
1540
canonical_python_exe ,
1539
1541
)
1540
1542
1543
+ # Create a `pythonw.exe` copy when an alternative executable is built, e.g., when
1544
+ # free-threading is enabled the name is `pythonw3.13t.exe`.
1545
+ canonical_pythonw_exe = install_dir / "pythonw.exe"
1546
+ if not canonical_pythonw_exe .exists ():
1547
+ shutil .copy2 (
1548
+ install_dir / pythonw_exe ,
1549
+ canonical_pythonw_exe ,
1550
+ )
1551
+
1541
1552
# CPython 3.13 removed `run_tests.py`, we provide a compatibility script
1542
1553
# for now.
1543
1554
if meets_python_minimum_version (python_version , "3.13" ):
0 commit comments