@@ -523,11 +523,14 @@ def hack_project_files(
523
523
524
524
# `--include-tcltk` is forced off on arm64, undo that
525
525
# See https://github.com/python/cpython/pull/132650
526
- static_replace_in_file (
527
- cpython_source_path / "PC" / "layout" / "main.py" ,
528
- rb'if ns.arch in ("arm32", "arm64"):' ,
529
- rb'if ns.arch == "arm32":' ,
530
- )
526
+ try :
527
+ static_replace_in_file (
528
+ cpython_source_path / "PC" / "layout" / "main.py" ,
529
+ rb'if ns.arch in ("arm32", "arm64"):' ,
530
+ rb'if ns.arch == "arm32":' ,
531
+ )
532
+ except NoSearchStringError :
533
+ pass
531
534
532
535
# Our SQLite directory is named weirdly. This throws off version detection
533
536
# in the project file. Replace the parsing logic with a static string.
@@ -1116,7 +1119,7 @@ def find_additional_dependencies(project: pathlib.Path):
1116
1119
elif arch == "arm64" :
1117
1120
abi_platform = "win_arm64"
1118
1121
else :
1119
- raise ValueError ("unhandled arch : %s" % arch )
1122
+ raise Exception ("unhandled architecture : %s" % arch )
1120
1123
1121
1124
if freethreaded :
1122
1125
abi_tag = ".cp%st-%s" % (python_majmin , abi_platform )
@@ -1216,7 +1219,7 @@ def find_additional_dependencies(project: pathlib.Path):
1216
1219
1217
1220
if name == "zlib" :
1218
1221
name = zlib_entry
1219
- :
1222
+
1220
1223
# On 3.14+ and aarch64, we use the latest tcl/tk version
1221
1224
if ext == "_tkinter" and (python_majmin == "314" or arch == "arm64" ):
1222
1225
name = name .replace ("-8612" , "" )
@@ -1308,7 +1311,11 @@ def build_cpython(
1308
1311
# runtime dependencies, so we are conservative and use the old version
1309
1312
# elsewhere. The old version isn't built for arm64, so we use the new
1310
1313
# 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"
1314
+ tk_bin_entry = (
1315
+ "tk-windows-bin"
1316
+ if meets_python_minimum_version (python_version , "3.14" ) or arch == "arm64"
1317
+ else "tk-windows-bin-8612"
1318
+ )
1312
1319
tk_bin_archive = download_entry (
1313
1320
tk_bin_entry , BUILD , local_name = "tk-windows-bin.tar.gz"
1314
1321
)
@@ -1396,7 +1403,13 @@ def build_cpython(
1396
1403
# Delete the tk nmake helper, it's not needed and links msvc
1397
1404
tcltk_commit : str = DOWNLOADS [tk_bin_entry ]["git_commit" ]
1398
1405
tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit )
1399
- (tcltk_path / build_directory / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe" ).unlink ()
1406
+ (
1407
+ tcltk_path
1408
+ / build_directory
1409
+ / "lib"
1410
+ / "nmake"
1411
+ / "x86_64-w64-mingw32-nmakehlp.exe"
1412
+ ).unlink ()
1400
1413
1401
1414
cpython_source_path = td / ("Python-%s" % python_version )
1402
1415
pcbuild_path = cpython_source_path / "PCbuild"
0 commit comments