mirror of
https://github.com/NohamR/pyzule-rw.git
synced 2026-10-11 02:49:40 +00:00
fix: not working on <=3.12
This commit is contained in:
@@ -7,7 +7,6 @@ import subprocess
|
|||||||
from typing import Optional
|
from typing import Optional
|
||||||
from glob import glob, iglob
|
from glob import glob, iglob
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
from importlib import resources # type: ignore
|
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
|
|
||||||
@@ -92,11 +91,14 @@ def get_tools_dir() -> tuple[str, str]:
|
|||||||
if "iPhone" in mach or "iPad" in mach:
|
if "iPhone" in mach or "iPad" in mach:
|
||||||
mach = "iOS"
|
mach = "iOS"
|
||||||
|
|
||||||
with resources.files() as files: # type: ignore
|
# thank god i dont have to use importlib,
|
||||||
return (
|
# it's the WORST standard library package prior to 3.12
|
||||||
str(files), # type: ignore
|
install_dir = os.path.dirname(__file__)
|
||||||
str(files / "tools" / system / mach) # type: ignore
|
|
||||||
)
|
return (
|
||||||
|
install_dir,
|
||||||
|
f"{install_dir}/tools/{system}/{mach}"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def delete_if_exists(path: str, bn: str) -> bool:
|
def delete_if_exists(path: str, bn: str) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user