Browse Source

Catch Exception instead of using bare except

Max Zheng 7 years ago
parent
commit
bb7d012b0a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      programs/more_decorator.py

+ 1 - 1
programs/more_decorator.py

@@ -12,7 +12,7 @@ def retry(f):
         for attempt in range(1, MAX_ATTEMPTS + 1):
         for attempt in range(1, MAX_ATTEMPTS + 1):
             try:
             try:
                 return f(*args, **kwargs)
                 return f(*args, **kwargs)
-            except:
+            except Exception:
                 log.exception("Attempt %s/%s failed : %s",
                 log.exception("Attempt %s/%s failed : %s",
                               attempt,
                               attempt,
                               MAX_ATTEMPTS,
                               MAX_ATTEMPTS,