1
0
Fork 0
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:
Glenn Pratt 2024-07-29 19:48:32 -07:00
parent 370f19bbee
commit 5313ff2955
No known key found for this signature in database

View file

@ -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