Skip to content

Commit

Permalink
fixed weird timeout default and added some missing plumbing
Browse files Browse the repository at this point in the history
Timeout default was False, which must have resulted from an editing
error, but we failed to pass it through where it was needed
anyway. Fixed now.
  • Loading branch information
Jim Fulton committed May 29, 2016
1 parent 357379f commit b0f317b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ZEO/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ def setup_delegation(self, loop):
from concurrent.futures import Future
call_soon_threadsafe = loop.call_soon_threadsafe

def call(meth, *args, timeout=False):
def call(meth, *args, timeout=None):
result = Future()
call_soon_threadsafe(meth, result, *args)
return self.wait_for_result(result, timeout)
Expand All @@ -714,15 +714,15 @@ def call(meth, *args, timeout=False):

def wait_for_result(self, future, timeout):
try:
return future.result(self.timeout if timeout is False else timeout)
return future.result(self.timeout if timeout is None else timeout)
except concurrent.futures.TimeoutError:
if not self.client.ready:
raise ClientDisconnected("timed out waiting for connection")
else:
raise

def call(self, method, *args, timeout=None):
return self.__call(self.call_threadsafe, method, args)
return self.__call(self.call_threadsafe, method, args, timeout=timeout)

def call_future(self, method, *args):
# for tests
Expand Down

0 comments on commit b0f317b

Please sign in to comment.