Fix RESPONSE_TIMEOUT dependency loops.

This commit is contained in:
Lance Stout
2010-11-17 15:13:09 -05:00
parent b8114b25ed
commit 6ee8a2980c
3 changed files with 20 additions and 8 deletions

View File

@@ -12,7 +12,7 @@ try:
except ImportError:
import Queue as queue
from sleekxmpp.xmlstream import StanzaBase, RESPONSE_TIMEOUT
from sleekxmpp.xmlstream import StanzaBase
from sleekxmpp.xmlstream.handler.base import BaseHandler
@@ -69,7 +69,7 @@ class Waiter(BaseHandler):
"""
pass
def wait(self, timeout=RESPONSE_TIMEOUT):
def wait(self, timeout=None):
"""
Block an event handler while waiting for a stanza to arrive.
@@ -84,6 +84,9 @@ class Waiter(BaseHandler):
arrive. Defaults to the global default timeout
value sleekxmpp.xmlstream.RESPONSE_TIMEOUT.
"""
if timeout is None:
timeout = self.stream.response_timeout
try:
stanza = self._payload.get(True, timeout)
except queue.Empty: