summaryrefslogtreecommitdiff
path: root/sleekxmpp/util/__init__.py
diff options
context:
space:
mode:
authorPedro Vicente <pedrovfer@gmail.com>2012-11-12 13:55:32 +0100
committerPedro Vicente <pedrovfer@gmail.com>2012-11-12 13:55:32 +0100
commita1d988fed5839a0d6f44340ed3dae8496e1b9a58 (patch)
tree0c2a657ad63afbeb2b82d0d3453608e8a907c04e /sleekxmpp/util/__init__.py
parent2d066c34fd58882901fea0d82c34ad37e312cd27 (diff)
parentb0c50b7a59fbc18cb01158fc901013a63ed87b90 (diff)
downloadslixmpp-a1d988fed5839a0d6f44340ed3dae8496e1b9a58.tar.gz
slixmpp-a1d988fed5839a0d6f44340ed3dae8496e1b9a58.tar.bz2
slixmpp-a1d988fed5839a0d6f44340ed3dae8496e1b9a58.tar.xz
slixmpp-a1d988fed5839a0d6f44340ed3dae8496e1b9a58.zip
Merge branch 'upgrading_sleekxmpp_1_1_11' into develop_sleek
Diffstat (limited to 'sleekxmpp/util/__init__.py')
-rw-r--r--sleekxmpp/util/__init__.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/sleekxmpp/util/__init__.py b/sleekxmpp/util/__init__.py
index 1e4af02d..957a9335 100644
--- a/sleekxmpp/util/__init__.py
+++ b/sleekxmpp/util/__init__.py
@@ -18,7 +18,18 @@ from sleekxmpp.util.misc_ops import bytes, unicode, hashes, hash, \
# Standardize import of Queue class:
import sys
-if 'gevent' in sys.modules:
+
+def _gevent_threads_enabled():
+ if not 'gevent' in sys.modules:
+ return False
+ try:
+ from gevent import thread as green_thread
+ thread = __import__('thread')
+ return thread.LockType is green_thread.LockType
+ except ImportError:
+ return False
+
+if _gevent_threads_enabled():
import gevent.queue as queue
Queue = queue.JoinableQueue
else: