Skip to content

Commit edbad8f

Browse files
committed
Include python.exe copy of python3.13t.exe in Windows free-threaded distributions
1 parent 9780ebb commit edbad8f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cpython-windows/build.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,15 @@ def build_cpython(
17181718
with (install_dir / "Scripts" / ".empty").open("ab"):
17191719
pass
17201720

1721+
# Rename to `python.exe` when an alternative executable is built, e.g., when
1722+
# free-threading is enabled the name is `python3.13t.exe`.
1723+
canonical_python_exe = install_dir / "python.exe"
1724+
if not canonical_python_exe.exists():
1725+
os.rename(
1726+
python_exe,
1727+
canonical_python_exe,
1728+
)
1729+
17211730
# Now copy the build artifacts into the output directory.
17221731
build_info = collect_python_build_artifacts(
17231732
pcbuild_path,
@@ -1811,13 +1820,12 @@ def build_cpython(
18111820
}
18121821

18131822
# Collect information from running Python script.
1814-
python_exe = out_dir / "python" / "install" / python_exe
18151823
metadata_path = td / "metadata.json"
18161824
env = dict(os.environ)
18171825
env["ROOT"] = str(out_dir / "python")
18181826
subprocess.run(
18191827
[
1820-
str(python_exe),
1828+
str(canonical_python_exe),
18211829
str(SUPPORT / "generate_metadata.py"),
18221830
str(metadata_path),
18231831
],

0 commit comments

Comments
 (0)