git rid of most of the bare excepts

This commit is contained in:
Jack O'Connor 2017-11-30 01:28:17 -05:00
parent 542671b4c5
commit 7e5873d336
3 changed files with 4 additions and 4 deletions

View File

@ -524,7 +524,7 @@ def delete_if_error(path):
given path, and allow the exception to continue.'''
try:
yield
except:
except Exception:
if os.path.exists(path):
os.remove(path)
raise

View File

@ -32,12 +32,12 @@ def _maybe_quote(val):
try:
int(val)
needs_quoting = True
except:
except Exception:
pass
try:
float(val)
needs_quoting = True
except:
except Exception:
pass
if needs_quoting:
return '"{}"'.format(val)

View File

@ -176,7 +176,7 @@ def _get_parallel_fetch_limit(args):
if parallel <= 0:
raise PrintableError('Argument to --jobs must be 1 or more.')
return parallel
except:
except Exception:
raise PrintableError('Argument to --jobs must be a number.')