Skip to content

Commit b11b85b

Browse files
emmatypingtomasr8
andauthored
Don't close tarfile if there is a BaseException
Co-authored-by: Tomas R. <[email protected]>
1 parent 58cf70c commit b11b85b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/tarfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,7 @@ def zstopen(cls, name, mode="r", fileobj=None, level=None, options=None,
20532053
if mode == 'r':
20542054
raise ReadError("not a zstd file") from e
20552055
raise
2056-
except:
2056+
except Exception:
20572057
fileobj.close()
20582058
raise
20592059
t._extfileobj = False

0 commit comments

Comments
 (0)