Skip to content

Commit

Permalink
Fix deprecated tarfile call
Browse files Browse the repository at this point in the history
  • Loading branch information
bennybp committed Nov 10, 2023
1 parent 6d8ca0d commit 0a59c5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion basis_set_exchange/tests/test_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"""

import os
import sys
import zipfile
import tarfile
import pytest
Expand All @@ -50,7 +51,10 @@ def _extract_all(filepath, extract_dir):
zf.extractall(extract_dir)
elif filepath.endswith('.tar.bz2'):
with tarfile.open(filepath, 'r:bz2') as tf:
tf.extractall(extract_dir)
if sys.version_info >= (3, 11):
tf.extractall(extract_dir, filter='fully_trusted')
else:
tf.extractall(extract_dir)
else:
raise RuntimeError("Unexpected file extension")

Expand Down

0 comments on commit 0a59c5d

Please sign in to comment.