Skip to content

Commit e450240

Browse files
committed
Add handling for pythont.exe
1 parent e30bc93 commit e450240

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

cpython-windows/build.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,12 @@ def build_cpython(
14301430
# as we do for Unix builds.
14311431
mpdecimal_archive = None
14321432

1433+
if freethreaded:
1434+
(major, minor, _) = python_version.split(".")
1435+
python_exe = f"python{major}.{minor}t.exe"
1436+
else:
1437+
python_exe = "python.exe"
1438+
14331439
if arch == "amd64":
14341440
build_platform = "x64"
14351441
build_directory = "amd64"
@@ -1532,7 +1538,7 @@ def build_cpython(
15321538
# test execution. We work around this by invoking the test harness
15331539
# separately for each test.
15341540
instrumented_python = (
1535-
pcbuild_path / build_directory / "instrumented" / "python.exe"
1541+
pcbuild_path / build_directory / "instrumented" / python_exe
15361542
)
15371543

15381544
tests = subprocess.run(
@@ -1647,7 +1653,7 @@ def build_cpython(
16471653
# Install pip and setuptools.
16481654
exec_and_log(
16491655
[
1650-
str(install_dir / "python.exe"),
1656+
str(install_dir / python_exe),
16511657
"-m",
16521658
"pip",
16531659
"install",
@@ -1664,7 +1670,7 @@ def build_cpython(
16641670
if meets_python_maximum_version(python_version, "3.11"):
16651671
exec_and_log(
16661672
[
1667-
str(install_dir / "python.exe"),
1673+
str(install_dir / python_exe),
16681674
"-m",
16691675
"pip",
16701676
"install",

cpython-windows/generate_metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
).decode("ascii"),
2727
"python_paths": {},
2828
"python_paths_abstract": sysconfig.get_paths(expand=False),
29-
"python_exe": "install/python.exe",
29+
"python_exe": "install/{os.path.basename(sys.executable)}",
3030
"python_major_minor_version": sysconfig.get_python_version(),
3131
"python_config_vars": {k: str(v) for k, v in sysconfig.get_config_vars().items()},
3232
}

0 commit comments

Comments
 (0)