mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-10 23:10:10 -04:00
replace 'except:' with 'except Exception:'
what could possibly go wrong
This commit is contained in:
parent
ecf198aab8
commit
eaaabc6c4f
54 changed files with 93 additions and 93 deletions
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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():
|
||||
|
|
|
@ -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",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue