replace 'except:' with 'except Exception:'

what could possibly go wrong
This commit is contained in:
Richard van der Hoff 2017-10-23 15:52:32 +01:00
parent ecf198aab8
commit eaaabc6c4f
54 changed files with 93 additions and 93 deletions

View file

@ -82,7 +82,7 @@ class Clock(object):
def cancel_call_later(self, timer, ignore_errs=False):
try:
timer.cancel()
except:
except Exception:
if not ignore_errs:
raise
@ -97,12 +97,12 @@ class Clock(object):
try:
ret_deferred.errback(e)
except:
except Exception:
pass
try:
given_deferred.cancel()
except:
except Exception:
pass
timer = None
@ -110,7 +110,7 @@ class Clock(object):
def cancel(res):
try:
self.cancel_call_later(timer)
except:
except Exception:
pass
return res
@ -119,7 +119,7 @@ class Clock(object):
def success(res):
try:
ret_deferred.callback(res)
except:
except Exception:
pass
return res
@ -127,7 +127,7 @@ class Clock(object):
def err(res):
try:
ret_deferred.errback(res)
except:
except Exception:
pass
given_deferred.addCallbacks(callback=success, errback=err)

View file

@ -73,7 +73,7 @@ class ObservableDeferred(object):
try:
# TODO: Handle errors here.
self._observers.pop().callback(r)
except:
except Exception:
pass
return r
@ -83,7 +83,7 @@ class ObservableDeferred(object):
try:
# TODO: Handle errors here.
self._observers.pop().errback(f)
except:
except Exception:
pass
if consumeErrors:
@ -205,7 +205,7 @@ class Linearizer(object):
try:
with PreserveLoggingContext():
yield current_defer
except:
except Exception:
logger.exception("Unexpected exception in Linearizer")
logger.info("Acquired linearizer lock %r for key %r", self.name,

View file

@ -42,7 +42,7 @@ try:
def get_thread_resource_usage():
return resource.getrusage(RUSAGE_THREAD)
except:
except Exception:
# If the system doesn't support resource.getrusage(RUSAGE_THREAD) then we
# won't track resource usage by returning None.
def get_thread_resource_usage():

View file

@ -189,7 +189,7 @@ class RetryDestinationLimiter(object):
yield self.store.set_destination_retry_timings(
self.destination, retry_last_ts, self.retry_interval
)
except:
except Exception:
logger.exception(
"Failed to store set_destination_retry_timings",
)