Skip to content

Commit 682c5f2

Browse files
committed
windows: look for new freeze_importlib content first
This line changed on Python 3.8. Let's look for the new line first and fall back to the old search string on failure. With this change, we can now actually start building Python 3.8. But a failure occurs during the build process.
1 parent b4293f0 commit 682c5f2

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cpython-windows/build.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -861,9 +861,18 @@ def hack_project_files(
861861
# Ditto for freeze_importlib, which isn't needed since we don't modify
862862
# the frozen importlib baked into the source distribution (
863863
# Python/importlib.h and Python/importlib_external.h).
864-
static_replace_in_file(
865-
pcbuild_proj, b'<Projects2 Include="_freeze_importlib.vcxproj" />', b""
866-
)
864+
try:
865+
# Python 3.8.
866+
static_replace_in_file(
867+
pcbuild_proj,
868+
b"""<Projects2 Condition="$(Platform) != 'ARM' and $(Platform) != 'ARM64'" Include="_freeze_importlib.vcxproj" />""",
869+
b"",
870+
)
871+
except NoSearchStringError:
872+
# Python 3.7.
873+
static_replace_in_file(
874+
pcbuild_proj, b'<Projects2 Include="_freeze_importlib.vcxproj" />', b""
875+
)
867876

868877

869878
PYPORT_EXPORT_SEARCH = b"""

0 commit comments

Comments
 (0)