summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/handler/waiter.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-07-24 02:39:54 -0700
committerLance Stout <lancestout@gmail.com>2012-07-24 02:39:54 -0700
commit3e43b36a9d70801d90a6b09046f93879f2e29b89 (patch)
tree758b0f60cb569605a91900fcbfd10d7bc364a243 /sleekxmpp/xmlstream/handler/waiter.py
parent352ee2f2fd6458a46e046ecaedb78addd5d6ac20 (diff)
downloadslixmpp-3e43b36a9d70801d90a6b09046f93879f2e29b89.tar.gz
slixmpp-3e43b36a9d70801d90a6b09046f93879f2e29b89.tar.bz2
slixmpp-3e43b36a9d70801d90a6b09046f93879f2e29b89.tar.xz
slixmpp-3e43b36a9d70801d90a6b09046f93879f2e29b89.zip
Standardize importing of queue class.
This will make it easier to enable gevent support.
Diffstat (limited to 'sleekxmpp/xmlstream/handler/waiter.py')
-rw-r--r--sleekxmpp/xmlstream/handler/waiter.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/sleekxmpp/xmlstream/handler/waiter.py b/sleekxmpp/xmlstream/handler/waiter.py
index 899df17c..66e14496 100644
--- a/sleekxmpp/xmlstream/handler/waiter.py
+++ b/sleekxmpp/xmlstream/handler/waiter.py
@@ -10,11 +10,8 @@
"""
import logging
-try:
- import queue
-except ImportError:
- import Queue as queue
+from sleekxmpp.util import Queue, QueueEmpty
from sleekxmpp.xmlstream.handler.base import BaseHandler
@@ -37,7 +34,7 @@ class Waiter(BaseHandler):
def __init__(self, name, matcher, stream=None):
BaseHandler.__init__(self, name, matcher, stream=stream)
- self._payload = queue.Queue()
+ self._payload = Queue()
def prerun(self, payload):
"""Store the matched stanza when received during processing.
@@ -74,7 +71,7 @@ class Waiter(BaseHandler):
try:
stanza = self._payload.get(True, 1)
break
- except queue.Empty:
+ except QueueEmpty:
elapsed_time += 1
if elapsed_time >= timeout:
log.warning("Timed out waiting for %s", self.name)