diff options
author | Richard van der Hoff <github@rvanderhoff.org.uk> | 2017-10-23 17:39:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 17:39:31 +0100 |
commit | 0d437698b2e040eface5094852576c43916c2e0c (patch) | |
tree | 9090c6c6f5ba5566786b8654cee07b3c3acd97c8 /synapse/util/__init__.py | |
parent | Merge pull request #2566 from matrix-org/rav/media_logcontext_leak (diff) | |
parent | fix vars named `l` (diff) | |
download | synapse-0d437698b2e040eface5094852576c43916c2e0c.tar.xz |
Merge pull request #2568 from matrix-org/rav/pep8
PEP8 fixes
Diffstat (limited to 'synapse/util/__init__.py')
-rw-r--r-- | synapse/util/__init__.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index 2a2360ab5d..756d8ffa32 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -59,9 +59,9 @@ class Clock(object): f(function): The function to call repeatedly. msec(float): How long to wait between calls in milliseconds. """ - l = task.LoopingCall(f) - l.start(msec / 1000.0, now=False) - return l + call = task.LoopingCall(f) + call.start(msec / 1000.0, now=False) + return call def call_later(self, delay, callback, *args, **kwargs): """Call something later @@ -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) |