fix: REALLY fix <=3.12

This commit is contained in:
zx
2024-09-07 09:31:10 -04:00
parent c5f5a4a4d1
commit 5d25dd2690

View File

@@ -4,6 +4,7 @@ import shutil
import zipfile
import platform
import subprocess
from uuid import uuid4
from typing import Optional
from glob import glob, iglob
from argparse import Namespace
@@ -116,8 +117,11 @@ def delete_if_exists(path: str, bn: str) -> bool:
return False
# damn it, literally EVERY FUCKING python version before 3.12 FUCKING SUCKS
def extract_deb(deb: str, tweaks: dict[str, str], tmpdir: str) -> None:
with TemporaryDirectory(prefix=tmpdir + "/", delete=False) as t2:
t2 = f"{tmpdir}/{uuid4()}"
os.mkdir(t2)
if platform.system() == "Linux":
tool = ["ar", "-x", deb, f"--output={t2}"]
else: