From 5011b2c3f1635b91ca680fd78dfc1cc0fb06ebcb Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Thu, 13 Apr 2023 07:54:44 -0600 Subject: [PATCH] Avoid 3.10 type hinting --- resources/integrity_verification.py | 5 +++-- resources/sys_patch/sys_patch_helpers.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/integrity_verification.py b/resources/integrity_verification.py index 2ea0d4d4ab..0144f779f2 100644 --- a/resources/integrity_verification.py +++ b/resources/integrity_verification.py @@ -9,6 +9,7 @@ import binascii import threading +from typing import Union from pathlib import Path CHUNK_LENGTH = 4 + 32 @@ -43,7 +44,7 @@ class ChunklistVerification: ... print(chunk_obj.error_msg) """ - def __init__(self, file_path: Path, chunklist_path: Path | bytes) -> None: + def __init__(self, file_path: Path, chunklist_path: Union[Path, bytes]) -> None: if isinstance(chunklist_path, bytes): self.chunklist_path: bytes = chunklist_path else: @@ -59,7 +60,7 @@ def __init__(self, file_path: Path, chunklist_path: Path | bytes) -> None: self.status: ChunklistStatus = ChunklistStatus.IN_PROGRESS - def _generate_chunks(self, chunklist: Path | bytes) -> dict: + def _generate_chunks(self, chunklist: Union[Path, bytes]) -> dict: """ Generate a dictionary of the chunklist header and chunks diff --git a/resources/sys_patch/sys_patch_helpers.py b/resources/sys_patch/sys_patch_helpers.py index b7affe1a05..1e98373267 100644 --- a/resources/sys_patch/sys_patch_helpers.py +++ b/resources/sys_patch/sys_patch_helpers.py @@ -5,6 +5,8 @@ import os import logging import subprocess + +from typing import Union from pathlib import Path from datetime import datetime @@ -213,7 +215,7 @@ def install_rsr_repair_binary(self): logging.info(f" - Failed to install RSRRepair: {result.stdout.decode()}") - def patch_gpu_compiler_libraries(self, mount_point: str | Path): + def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]): """ Fix GPUCompiler.framework's libraries to resolve linking issues