diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index aaec9a40cd0..bd7331e1a13 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -521,7 +521,7 @@ def expand(self): "Failed on expand() for URL %s" % self.url) if not self.extension: - self.extension = extension(self.archive_file) + self.extension = extension(self.url) if self.stage.expanded: tty.debug('Source already staged to %s' % self.stage.source_path) diff --git a/lib/spack/spack/util/compression.py b/lib/spack/spack/util/compression.py index 9a8eda0c913..18c0a9ea5e2 100644 --- a/lib/spack/spack/util/compression.py +++ b/lib/spack/spack/util/compression.py @@ -246,7 +246,7 @@ def _7zip(archive_file): return outfile -def decompressor_for(path, ext=None): +def decompressor_for(path, ext): """Returns a function pointer to appropriate decompression algorithm based on extension type. @@ -254,9 +254,6 @@ def decompressor_for(path, ext=None): path (str): path of the archive file requiring decompression ext (str): Extension of archive file """ - if not ext: - ext = extension(path) - if not allowed_archive(ext): raise CommandNotFoundError("Cannot extract archive, \ unrecognized file extension: '%s'" % ext)