From 4cc2dab964706292636d844b8377fe8b2bd4212d Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Wed, 5 Jan 2022 12:50:17 -0700 Subject: [PATCH] sys_patch.py: Add partial download error handling Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/873 --- resources/sys_patch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/sys_patch.py b/resources/sys_patch.py index fb0364181..7c738b49e 100644 --- a/resources/sys_patch.py +++ b/resources/sys_patch.py @@ -709,15 +709,17 @@ set million colour before rebooting""" print("- Removing old Apple Binaries zip") Path(self.constants.payload_apple_root_path_zip).unlink() + download_result = None local_zip = Path(self.constants.payload_path) / f"{os_ver}.zip" if Path(local_zip).exists(): print(f"- Found local {os_ver} zip, skipping download") print(f"- Duplicating into Apple.zip") shutil.copy(local_zip, self.constants.payload_apple_root_path_zip) + download_result = True else: - utilities.download_file(link, self.constants.payload_apple_root_path_zip) + download_result = utilities.download_file(link, self.constants.payload_apple_root_path_zip) - if self.constants.payload_apple_root_path_zip.exists(): + if download_result and self.constants.payload_apple_root_path_zip.exists(): print("- Download completed") print("- Unzipping download...") try: