forked from benoitc/gunicorn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gaiohttp.py
27 lines (23 loc) · 798 Bytes
/
gaiohttp.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import sys
from gunicorn import util
if sys.version_info >= (3, 4):
try:
import aiohttp # NOQA
except ImportError:
raise RuntimeError("You need aiohttp installed to use this worker.")
else:
try:
from aiohttp.worker import GunicornWebWorker as AiohttpWorker
except ImportError:
from gunicorn.workers._gaiohttp import AiohttpWorker
util.warn(
"The 'gaiohttp' worker is deprecated. See --worker-class "
"documentation for more information."
)
__all__ = ['AiohttpWorker']
else:
raise RuntimeError("You need Python >= 3.4 to use the gaiohttp worker")