Skip to content

Commit

Permalink
Update compression.py
Browse files Browse the repository at this point in the history
  • Loading branch information
吴坎 authored Mar 25, 2024
1 parent a8d7cd4 commit 8c72f03
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/spack/spack/util/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,14 @@ def replace(
result.gname = gname
return result

def data_filter(member, dest_path):
new_attrs = _get_filtered_attrs(member, dest_path, True)
# python@:3.11 does not support data_filter, use tar_filter instead
def tar_filter(member, dest_path):
new_attrs = _get_filtered_attrs(member, dest_path, Fals)
if new_attrs:
return replace(member, **new_attrs, deep=False)
return member

_data_filter = getattr(tarfile, "data_filter", data_filter)
_data_filter = getattr(tarfile, "data_filter", tar_filter)

except ImportError:
TARFILE_SUPPORTED = False
Expand Down

0 comments on commit 8c72f03

Please sign in to comment.