Skip to content

Commit d4fd8ac

Browse files
committed
Rename python3.13t.exe to python.exe in Windows free-threaded distributions
1 parent 6e1ce43 commit d4fd8ac

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
@@ -1759,6 +1759,15 @@ def build_cpython(
17591759
log("copying %s to %s" % (source, dest))
17601760
shutil.copyfile(source, dest)
17611761

1762+
# Rename to `python.exe` when an alternative executable is built, e.g., when
1763+
# free-threading is enabled the name is `python3.13t.exe`.
1764+
canonical_python_exe = install_dir / "python.exe"
1765+
if not canonical_python_exe.exists():
1766+
os.rename(
1767+
install_dir / python_exe,
1768+
canonical_python_exe,
1769+
)
1770+
17621771
# CPython 3.13 removed `run_tests.py`, we provide a compatibility script
17631772
# for now.
17641773
if meets_python_minimum_version(python_version, "3.13"):
@@ -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)