mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-11-13 00:00:41 -05:00
Replace returnValue with return (#5736)
This commit is contained in:
parent
18a466b84e
commit
4806651744
177 changed files with 1359 additions and 1513 deletions
|
|
@ -49,7 +49,7 @@ class Clock(object):
|
|||
with context.PreserveLoggingContext():
|
||||
self._reactor.callLater(seconds, d.callback, seconds)
|
||||
res = yield d
|
||||
defer.returnValue(res)
|
||||
return res
|
||||
|
||||
def time(self):
|
||||
"""Returns the current system time in seconds since epoch."""
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ class ReadWriteLock(object):
|
|||
new_defer.callback(None)
|
||||
self.key_to_current_readers.get(key, set()).discard(new_defer)
|
||||
|
||||
defer.returnValue(_ctx_manager())
|
||||
return _ctx_manager()
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def write(self, key):
|
||||
|
|
@ -396,7 +396,7 @@ class ReadWriteLock(object):
|
|||
if self.key_to_current_writer[key] == new_defer:
|
||||
self.key_to_current_writer.pop(key)
|
||||
|
||||
defer.returnValue(_ctx_manager())
|
||||
return _ctx_manager()
|
||||
|
||||
|
||||
def _cancelled_to_timed_out_error(value, timeout):
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ class CacheDescriptor(_CacheDescriptorBase):
|
|||
def foo(self, key, cache_context):
|
||||
r1 = yield self.bar1(key, on_invalidate=cache_context.invalidate)
|
||||
r2 = yield self.bar2(key, on_invalidate=cache_context.invalidate)
|
||||
defer.returnValue(r1 + r2)
|
||||
return r1 + r2
|
||||
|
||||
Args:
|
||||
num_args (int): number of positional arguments (excluding ``self`` and
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ class ResponseCache(object):
|
|||
@defer.inlineCallbacks
|
||||
def handle_request(request):
|
||||
# etc
|
||||
defer.returnValue(result)
|
||||
return result
|
||||
|
||||
result = yield response_cache.wrap(
|
||||
key,
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ def measure_func(name):
|
|||
def measured_func(self, *args, **kwargs):
|
||||
with Measure(self.clock, name):
|
||||
r = yield func(self, *args, **kwargs)
|
||||
defer.returnValue(r)
|
||||
return r
|
||||
|
||||
return measured_func
|
||||
|
||||
|
|
|
|||
|
|
@ -95,15 +95,13 @@ def get_retry_limiter(destination, clock, store, ignore_backoff=False, **kwargs)
|
|||
# maximum backoff even though it might only have been down briefly
|
||||
backoff_on_failure = not ignore_backoff
|
||||
|
||||
defer.returnValue(
|
||||
RetryDestinationLimiter(
|
||||
destination,
|
||||
clock,
|
||||
store,
|
||||
retry_interval,
|
||||
backoff_on_failure=backoff_on_failure,
|
||||
**kwargs
|
||||
)
|
||||
return RetryDestinationLimiter(
|
||||
destination,
|
||||
clock,
|
||||
store,
|
||||
retry_interval,
|
||||
backoff_on_failure=backoff_on_failure,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue