mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix bare except
This commit is contained in:
parent
370f19bbee
commit
5313ff2955
1 changed files with 3 additions and 3 deletions
|
@ -551,10 +551,10 @@ class TGZFileWithMtime(tarfile.TarFile):
|
|||
if fileobj is None:
|
||||
fileobj = open(name, mode + "b")
|
||||
|
||||
# filename intentionally empty to match GNU tar
|
||||
try:
|
||||
# filename intentionally empty to match GNU tar
|
||||
gzipfileobj = gzip.GzipFile("", mode, compresslevel, fileobj, mtime)
|
||||
except:
|
||||
except Exception:
|
||||
fileobj.close()
|
||||
raise
|
||||
|
||||
|
@ -563,7 +563,7 @@ class TGZFileWithMtime(tarfile.TarFile):
|
|||
|
||||
try:
|
||||
super(TGZFileWithMtime, self).__init__(mode="w", fileobj=gzipfileobj, **kwargs)
|
||||
except:
|
||||
except Exception:
|
||||
gzipfileobj.close()
|
||||
raise
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue