We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fb69a24 commit 7fc553aCopy full SHA for 7fc553a
1 file changed
biothings/utils/common.py
@@ -219,10 +219,10 @@ def anyfile(infile, mode="r"):
219
tar_file = tarfile.open(infile, mode) # pylint: disable=consider-using-with
220
try:
221
extracted = tar_file.extractfile(rawfile)
222
- except KeyError:
+ except KeyError as exc:
223
# provided rawfile does not appear in the tarball
224
tar_file.close()
225
- raise FileNotFoundError("target member does not contain the provided tar file.")
+ raise FileNotFoundError("target member does not contain the provided tar file.") from exc
226
227
# extracted member is not a regular file or link
228
if extracted is None:
0 commit comments