Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-kan authored Mar 24, 2024
1 parent 12517c5 commit de9050e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/spack/spack/util/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def _untar(archive_file: str, remove_archive_file: bool = False) -> str:
Can be one of .tar(.[gz|bz2|xz|Z]) or .(tgz|tbz|tbz2|txz).
"""
try:
return _py_untar(archive_file, remove_archive_file)
except:
return _system_untar(archive_file, remove_archive_file)
except:
return _py_untar(archive_file, remove_archive_file)


def _py_untar(archive_file: str, remove_archive_file: bool = False) -> str:
Expand All @@ -79,7 +79,7 @@ def _py_untar(archive_file: str, remove_archive_file: bool = False) -> str:
# also have other extensions (on Unix) such as tgz, tbz2, ...
archive_file = archive_file_no_ext + "-input"
shutil.move(archive_file_no_ext, archive_file)
tarfile.open(archive_file).extractall(path = outfile)
tarfile.open(archive_file).extractall()
if remove_archive_file:
# remove input file to prevent two stage
# extractions from being treated as exploding
Expand Down

0 comments on commit de9050e

Please sign in to comment.