From da4b2cad57196ceb6faa45d56f95871dd4dc5c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sun, 26 Oct 2025 16:31:33 +0100 Subject: [PATCH] fix install on older systems --- npm_install.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/npm_install.py b/npm_install.py index 8d1329c..6d12b63 100644 --- a/npm_install.py +++ b/npm_install.py @@ -296,8 +296,13 @@ def download_extract_tar_gz(url: str, dest_dir: Path) -> Path: with tarfile.open(tf_path, "r:gz") as t: try: t.extractall(dest_dir, filter="data") - except (TypeError, tarfile.LinkOutsideDestinationError): + except TypeError: t.extractall(dest_dir) + except Exception as e: + if 'LinkOutsideDestinationError' in str(type(e).__name__): + t.extractall(dest_dir) + else: + raise top = t.getmembers()[0].name.split("/")[0] os.unlink(tf_path) return dest_dir / top