From ff6169cc20fe0e97f9db7f670d2b56ce8c5573be Mon Sep 17 00:00:00 2001 From: benoitc Date: Sun, 1 Jun 2014 20:44:50 +0200 Subject: [PATCH] gthreads: only check requirements for python < 3.4 --- gunicorn/workers/gthread.py | 18 ++++++++++++++++-- setup.py | 3 --- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gunicorn/workers/gthread.py b/gunicorn/workers/gthread.py index 0f486642..aedfdd93 100644 --- a/gunicorn/workers/gthread.py +++ b/gunicorn/workers/gthread.py @@ -11,7 +11,6 @@ # closed. from collections import deque -import concurrent.futures as futures from datetime import datetime import errno from functools import partial @@ -28,10 +27,25 @@ from .. import util from . import base from .. import six + +try: + import concurrent.futures as futures +except ImportError: + raise RuntimeError(""" + You need 'concurrent' installed to use this worker with this python + version. + """) + try: from asyncio import selectors except ImportError: - from trollius import selectors + try: + from trollius import selectors + except ImportError: + raise RuntimeError(""" + You need 'trollius' installed to use this worker with this python + version. + """) class TConn(): diff --git a/setup.py b/setup.py index 36e33853..6f5b5b69 100644 --- a/setup.py +++ b/setup.py @@ -63,9 +63,6 @@ class PyTest(Command): REQUIREMENTS = [] -if sys.version_info[0] == 2: - REQUIREMENTS.append('futures') - setup( name = 'gunicorn',