Skip to content

Commit 1b37af1

Browse files
committed
Use consistency exception type
1 parent 024f688 commit 1b37af1

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

cpython-windows/build.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,7 @@ def find_additional_dependencies(project: pathlib.Path):
11161116
elif arch == "arm64":
11171117
abi_platform = "win_arm64"
11181118
else:
1119-
raise ValueError("unhandled arch: %s" % arch)
1119+
raise Exception("unhandled architecture: %s" % arch)
11201120

11211121
if freethreaded:
11221122
abi_tag = ".cp%st-%s" % (python_majmin, abi_platform)
@@ -1216,7 +1216,7 @@ def find_additional_dependencies(project: pathlib.Path):
12161216

12171217
if name == "zlib":
12181218
name = zlib_entry
1219-
:
1219+
12201220
# On 3.14+ and aarch64, we use the latest tcl/tk version
12211221
if ext == "_tkinter" and (python_majmin == "314" or arch == "arm64"):
12221222
name = name.replace("-8612", "")
@@ -1308,7 +1308,11 @@ def build_cpython(
13081308
# runtime dependencies, so we are conservative and use the old version
13091309
# elsewhere. The old version isn't built for arm64, so we use the new
13101310
# version there too
1311-
tk_bin_entry = "tk-windows-bin" if meets_python_minimum_version(python_version, "3.14") or arch == "arm64" else "tk-windows-bin-8612"
1311+
tk_bin_entry = (
1312+
"tk-windows-bin"
1313+
if meets_python_minimum_version(python_version, "3.14") or arch == "arm64"
1314+
else "tk-windows-bin-8612"
1315+
)
13121316
tk_bin_archive = download_entry(
13131317
tk_bin_entry, BUILD, local_name="tk-windows-bin.tar.gz"
13141318
)
@@ -1396,7 +1400,13 @@ def build_cpython(
13961400
# Delete the tk nmake helper, it's not needed and links msvc
13971401
tcltk_commit: str = DOWNLOADS[tk_bin_entry]["git_commit"]
13981402
tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit)
1399-
(tcltk_path / build_directory / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe").unlink()
1403+
(
1404+
tcltk_path
1405+
/ build_directory
1406+
/ "lib"
1407+
/ "nmake"
1408+
/ "x86_64-w64-mingw32-nmakehlp.exe"
1409+
).unlink()
14001410

14011411
cpython_source_path = td / ("Python-%s" % python_version)
14021412
pcbuild_path = cpython_source_path / "PCbuild"

0 commit comments

Comments
 (0)