aboutsummaryrefslogtreecommitdiff
path: root/gn3/fs_helpers.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
committerFrederick Muriuki Muriithi2022-03-11 11:51:02 +0300
commit9691e225724e041997c74f8665dcbfa12bb1c579 (patch)
tree271d99dbf6d72161e343ddf8765f9543fe752e37 /gn3/fs_helpers.py
parenta7696cc668e00215e1d5af2425765451811bca9d (diff)
downloadgenenetwork3-9691e225724e041997c74f8665dcbfa12bb1c579.tar.gz
Fix some linting issues
Diffstat (limited to 'gn3/fs_helpers.py')
-rw-r--r--gn3/fs_helpers.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/gn3/fs_helpers.py b/gn3/fs_helpers.py
index 578269b..f313086 100644
--- a/gn3/fs_helpers.py
+++ b/gn3/fs_helpers.py
@@ -71,9 +71,8 @@ contents to TARGET_DIR/<dir-hash>.
os.mkdir(os.path.join(target_dir, token))
gzipped_file.save(tar_target_loc)
# Extract to "tar_target_loc/token"
- tar = tarfile.open(tar_target_loc)
- tar.extractall(path=os.path.join(target_dir, token))
- tar.close()
+ with tarfile.open(tar_target_loc) as tar:
+ tar.extractall(path=os.path.join(target_dir, token))
# pylint: disable=W0703
except Exception:
return {"status": 128, "error": "gzip failed to unpack file"}