From c5f5a4a4d10099781764735c3278c525e931061c Mon Sep 17 00:00:00 2001 From: zx Date: Sat, 7 Sep 2024 09:25:58 -0400 Subject: [PATCH] fix: not working on <=3.12 --- cyan/tbhutils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cyan/tbhutils.py b/cyan/tbhutils.py index 2d42e9d..61ce8b8 100644 --- a/cyan/tbhutils.py +++ b/cyan/tbhutils.py @@ -7,7 +7,6 @@ import subprocess from typing import Optional from glob import glob, iglob from argparse import Namespace -from importlib import resources # type: ignore from tempfile import TemporaryDirectory @@ -92,11 +91,14 @@ def get_tools_dir() -> tuple[str, str]: if "iPhone" in mach or "iPad" in mach: mach = "iOS" - with resources.files() as files: # type: ignore - return ( - str(files), # type: ignore - str(files / "tools" / system / mach) # type: ignore - ) + # thank god i dont have to use importlib, + # it's the WORST standard library package prior to 3.12 + install_dir = os.path.dirname(__file__) + + return ( + install_dir, + f"{install_dir}/tools/{system}/{mach}" + ) def delete_if_exists(path: str, bn: str) -> bool: