Remove support for gevent, incompatible with python3.

This commit is contained in:
Emmanuel Gil Peyrot
2014-08-19 11:58:33 +02:00
committed by Florent Le Coz
parent 70839368c1
commit 5a8881000c
2 changed files with 7 additions and 26 deletions

View File

@@ -18,26 +18,10 @@ from slixmpp.util.misc_ops import bytes, unicode, hashes, hash, \
# =====================================================================
# Standardize import of Queue class:
import sys
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:
try:
import queue
except ImportError:
import Queue as queue
Queue = queue.Queue
try:
import queue
except ImportError:
import Queue as queue
Queue = queue.Queue
QueueEmpty = queue.Empty