diff options
-rw-r--r-- | slixmpp/util/__init__.py | 26 | ||||
-rwxr-xr-x | testall.py | 7 |
2 files changed, 7 insertions, 26 deletions
diff --git a/slixmpp/util/__init__.py b/slixmpp/util/__init__.py index b4243e83..df09f771 100644 --- a/slixmpp/util/__init__.py +++ b/slixmpp/util/__init__.py @@ -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 @@ -1,9 +1,6 @@ #!/usr/bin/env python3 import sys -if len(sys.argv)>1 and sys.argv[1].lower() == 'gevent': - from gevent import monkey - monkey.patch_all() import os import logging @@ -61,7 +58,7 @@ class TestCommand(distutils.core.Command): if __name__ == '__main__': result = run_tests() - print("<tests %s ran='%s' errors='%s' fails='%s' success='%s' gevent_enabled=%s/>" % ( + print("<tests %s ran='%s' errors='%s' fails='%s' success='%s'/>" % ( "xmlns='http//andyet.net/protocol/tests'", result.testsRun, len(result.errors), - len(result.failures), result.wasSuccessful(),'gevent' in sys.modules)) + len(result.failures), result.wasSuccessful())) |