Avoid 3.10 type hinting

This commit is contained in:
Mykola Grymalyuk
2023-04-13 07:54:44 -06:00
parent 980142c6ad
commit 5011b2c3f1
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -9,6 +9,7 @@ import logging
import binascii import binascii
import threading import threading
from typing import Union
from pathlib import Path from pathlib import Path
CHUNK_LENGTH = 4 + 32 CHUNK_LENGTH = 4 + 32
@@ -43,7 +44,7 @@ class ChunklistVerification:
... print(chunk_obj.error_msg) ... 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): if isinstance(chunklist_path, bytes):
self.chunklist_path: bytes = chunklist_path self.chunklist_path: bytes = chunklist_path
else: else:
@@ -59,7 +60,7 @@ class ChunklistVerification:
self.status: ChunklistStatus = ChunklistStatus.IN_PROGRESS 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 Generate a dictionary of the chunklist header and chunks
+3 -1
View File
@@ -5,6 +5,8 @@ import plistlib
import os import os
import logging import logging
import subprocess import subprocess
from typing import Union
from pathlib import Path from pathlib import Path
from datetime import datetime from datetime import datetime
@@ -213,7 +215,7 @@ class SysPatchHelpers:
logging.info(f" - Failed to install RSRRepair: {result.stdout.decode()}") 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 Fix GPUCompiler.framework's libraries to resolve linking issues