diff options
author | Sangeeth Saravanaraj <sangeeth@riptideio.com> | 2015-04-28 16:53:40 +0530 |
---|---|---|
committer | Sangeeth Saravanaraj <sangeeth@riptideio.com> | 2015-04-28 16:53:40 +0530 |
commit | 80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb (patch) | |
tree | ecb5905d19a563b4e6fe864afd0122321bf7cea1 /sleekxmpp/util/__init__.py | |
parent | 904480712157d762d35de16ce55202d641a56b3c (diff) | |
parent | 842157a6cc25d9e85e6e31b3cf3349ba83ece101 (diff) | |
download | slixmpp-80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb.tar.gz slixmpp-80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb.tar.bz2 slixmpp-80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb.tar.xz slixmpp-80b60fc0483b21c8d5829b61cabbf9b46aa2c2fb.zip |
Merge remote-tracking branch 'origin/develop' into xep_0332
Diffstat (limited to 'sleekxmpp/util/__init__.py')
-rw-r--r-- | sleekxmpp/util/__init__.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sleekxmpp/util/__init__.py b/sleekxmpp/util/__init__.py index 05286d33..47a935af 100644 --- a/sleekxmpp/util/__init__.py +++ b/sleekxmpp/util/__init__.py @@ -32,12 +32,17 @@ def _gevent_threads_enabled(): if _gevent_threads_enabled(): import gevent.queue as queue - Queue = queue.JoinableQueue + _queue = queue.JoinableQueue else: try: import queue except ImportError: import Queue as queue - Queue = queue.Queue + _queue = queue.Queue +class Queue(_queue): + def put(self, item, block=True, timeout=None): + if _queue.full(self): + _queue.get(self) + return _queue.put(self, item, block, timeout) QueueEmpty = queue.Empty |