mirror of https://github.com/buildinspace/peru.git
git rid of most of the bare excepts
This commit is contained in:
parent
542671b4c5
commit
7e5873d336
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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.')
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue