Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix asyncio worker handling #831

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion gunicorn/workers/gaiohttp.py
Expand Up @@ -4,11 +4,19 @@
# See the NOTICE for more information.
__all__ = ['AiohttpWorker']

import asyncio
import functools
import os
import sys

import gunicorn.workers.base as base


if sys.version_info >= (3, 3):
import asyncio
else:
RuntimeError("You need Python >= 3.3 to use the asyncio worker")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is the raise?



try:
from aiohttp.wsgi import WSGIServerHttpProtocol
except ImportError:
Expand Down
18 changes: 2 additions & 16 deletions setup.py
Expand Up @@ -5,15 +5,12 @@


import os
from setuptools import setup, Command
from setuptools import setup, find_packages, Command
import sys

from gunicorn import __version__


ASYNCIO_COMPAT = sys.version_info >= (3, 3)


CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Other Environment',
Expand Down Expand Up @@ -68,17 +65,6 @@ def run(self):

REQUIREMENTS = []

py_modules = []

for root, folders, files in os.walk('gunicorn'):
for f in files:
if f.endswith('.py') and (ASYNCIO_COMPAT or f != 'gaiohttp.py'):
full = os.path.join(root, f[:-3])
parts = full.split(os.path.sep)
modname = '.'.join(parts)
py_modules.append(modname)


setup(
name = 'gunicorn',
version = __version__,
Expand All @@ -92,7 +78,7 @@ def run(self):

classifiers = CLASSIFIERS,
zip_safe = False,
py_modules = py_modules,
packages = find_packages(exclude=['examples', 'tests']),
include_package_data = True,

tests_require = tests_require,
Expand Down