diff options
author | Lance Stout <lancestout@gmail.com> | 2012-10-24 01:20:23 -0700 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2012-10-24 01:20:23 -0700 |
commit | 2a4e4352282e393e2843bc8d4c5847d7351ef34c (patch) | |
tree | 34bcb68a0f93af65485823745db4d70ba5e1f08a /sleekxmpp/util | |
parent | c5046b9c91a77488424c1f77407a2875a9fea45a (diff) | |
download | slixmpp-2a4e4352282e393e2843bc8d4c5847d7351ef34c.tar.gz slixmpp-2a4e4352282e393e2843bc8d4c5847d7351ef34c.tar.bz2 slixmpp-2a4e4352282e393e2843bc8d4c5847d7351ef34c.tar.xz slixmpp-2a4e4352282e393e2843bc8d4c5847d7351ef34c.zip |
Enable gevent support.
Closes issues #166 and #167
Thanks to @pvicent, @chason, and @gabriel-samfira
Diffstat (limited to 'sleekxmpp/util')
-rw-r--r-- | sleekxmpp/util/__init__.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sleekxmpp/util/__init__.py b/sleekxmpp/util/__init__.py index 7637dda0..1e4af02d 100644 --- a/sleekxmpp/util/__init__.py +++ b/sleekxmpp/util/__init__.py @@ -17,11 +17,15 @@ from sleekxmpp.util.misc_ops import bytes, unicode, hashes, hash, \ # ===================================================================== # Standardize import of Queue class: -try: - import queue -except ImportError: - import Queue as queue +import sys +if 'gevent' in sys.modules: + import gevent.queue as queue + Queue = queue.JoinableQueue +else: + try: + import queue + except ImportError: + import Queue as queue + Queue = queue.Queue - -Queue = queue.Queue QueueEmpty = queue.Empty |