From 7e5873d3368ade522bc941a2ccc0ca2e605065d5 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Thu, 30 Nov 2017 01:28:17 -0500 Subject: [PATCH] git rid of most of the bare excepts --- peru/cache.py | 2 +- peru/edit_yaml.py | 4 ++-- peru/runtime.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/peru/cache.py b/peru/cache.py index 3114f13..9d22f06 100644 --- a/peru/cache.py +++ b/peru/cache.py @@ -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 diff --git a/peru/edit_yaml.py b/peru/edit_yaml.py index b225d58..93a1884 100644 --- a/peru/edit_yaml.py +++ b/peru/edit_yaml.py @@ -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) diff --git a/peru/runtime.py b/peru/runtime.py index 7c876f1..d4f4097 100644 --- a/peru/runtime.py +++ b/peru/runtime.py @@ -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.')