summaryrefslogtreecommitdiff
path: root/src/buildstream/plugins/sources/tar.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/plugins/sources/tar.py')
-rw-r--r--src/buildstream/plugins/sources/tar.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/buildstream/plugins/sources/tar.py b/src/buildstream/plugins/sources/tar.py
index 7e5868baa..8bc0cc743 100644
--- a/src/buildstream/plugins/sources/tar.py
+++ b/src/buildstream/plugins/sources/tar.py
@@ -115,9 +115,7 @@ class TarSource(DownloadableFileSource):
def _get_tar(self):
if self.url.endswith(".lz"):
with self._run_lzip() as lzip_dec:
- with tarfile.open(
- fileobj=lzip_dec, mode="r:", tarinfo=ReadableTarInfo
- ) as tar:
+ with tarfile.open(fileobj=lzip_dec, mode="r:", tarinfo=ReadableTarInfo) as tar:
yield tar
else:
with tarfile.open(self._get_mirror_file(), tarinfo=ReadableTarInfo) as tar:
@@ -132,8 +130,7 @@ class TarSource(DownloadableFileSource):
if base_dir:
tar.extractall(
- path=directory,
- members=self._extract_members(tar, base_dir, directory),
+ path=directory, members=self._extract_members(tar, base_dir, directory),
)
else:
tar.extractall(path=directory)
@@ -244,11 +241,7 @@ class TarSource(DownloadableFileSource):
paths = self._list_tar_paths(tar)
matches = sorted(list(utils.glob(paths, pattern)))
if not matches:
- raise SourceError(
- "{}: Could not find base directory matching pattern: {}".format(
- self, pattern
- )
- )
+ raise SourceError("{}: Could not find base directory matching pattern: {}".format(self, pattern))
return matches[0]