mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 05:40:01 +10:00
Avoid 3.10 type hinting
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user