mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Update bare exceptions to specify Exception.
This will keep us from accidentally catching program-exiting exceptions like KeyboardInterupt and SystemExit.
This commit is contained in:
parent
5147e792d3
commit
3fba006207
320 changed files with 659 additions and 656 deletions
|
@ -532,7 +532,7 @@ def main():
|
|||
mimetype, charset = out.split(':')[1].split(';')
|
||||
output['mimetype'] = mimetype.strip()
|
||||
output['charset'] = charset.split('=')[1].strip()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# try to get attr data
|
||||
|
|
|
@ -241,7 +241,7 @@ class ZipArchive(object):
|
|||
try:
|
||||
for item in archive.infolist():
|
||||
self._infodict[item.filename] = int(item.CRC)
|
||||
except:
|
||||
except Exception:
|
||||
archive.close()
|
||||
raise UnarchiveError('Unable to list files in the archive')
|
||||
|
||||
|
@ -273,7 +273,7 @@ class ZipArchive(object):
|
|||
break
|
||||
if not exclude_flag:
|
||||
self._files_in_archive.append(to_native(member))
|
||||
except:
|
||||
except Exception:
|
||||
archive.close()
|
||||
raise UnarchiveError('Unable to list files in the archive')
|
||||
|
||||
|
@ -328,7 +328,7 @@ class ZipArchive(object):
|
|||
else:
|
||||
try:
|
||||
fut_owner = run_owner
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
fut_uid = run_uid
|
||||
|
||||
|
@ -347,7 +347,7 @@ class ZipArchive(object):
|
|||
else:
|
||||
try:
|
||||
fut_group = run_group
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
fut_gid = run_gid
|
||||
|
||||
|
@ -427,7 +427,7 @@ class ZipArchive(object):
|
|||
dest = os.path.join(self.dest, path)
|
||||
try:
|
||||
st = os.lstat(dest)
|
||||
except:
|
||||
except Exception:
|
||||
change = True
|
||||
self.includes.append(path)
|
||||
err += 'Path %s is missing\n' % path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue