summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2020-06-10 17:54:22 +0200
committerMax Kellermann <max@musicpd.org>2020-06-10 17:54:22 +0200
commit96a273bf3ba60fdfb4faadfb716ebd0e57b346a7 (patch)
treeeddc037b42caa270c59249156cdb773c0165a9ea
parent66c27d2c137a87683f3ba2582199b1b7ef292dee (diff)
parent9a4059ba395a3ad868e86d9f9eeafa8e2b9f42ef (diff)
Merge branch 'misc/tar-python' of git://github.com/ibmibmibm/MPD
-rw-r--r--python/build/tar.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/python/build/tar.py b/python/build/tar.py
index 15bbfca6b..7cb7db67c 100644
--- a/python/build/tar.py
+++ b/python/build/tar.py
@@ -7,5 +7,11 @@ def untar(tarball_path, parent_path, base):
except FileNotFoundError:
pass
os.makedirs(parent_path, exist_ok=True)
- subprocess.check_call(['/bin/tar', 'xfC', tarball_path, parent_path])
+ try:
+ subprocess.check_call(['/bin/tar', 'xfC', tarball_path, parent_path])
+ except FileNotFoundError:
+ import tarfile
+ tar = tarfile.open(tarball_path)
+ tar.extractall(path=parent_path)
+ tar.close()
return path