Merge pull request #1796 from diegoholiveira/1795-rename-async-module

1795 rename async module
This commit is contained in:
Randall Leeds 2018-06-17 13:22:31 -07:00 committed by GitHub
commit bd833e0009
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 6 deletions

1
THANKS
View File

@ -49,6 +49,7 @@ Dariusz Suchojad <dsuch-github@m.zato.io>
David Vincelli <david@freshbooks.com>
David Wolever <david@wolever.net>
Denis Bilenko <denis.bilenko@gmail.com>
Diego Oliveira <contact@diegoholiveira.com>
Dima Barsky <github@kappa.ac93.org>
Djoume Salvetti <djoume@freshbooks.com>
Dmitry Medvinsky <me@dmedvinsky.name>

View File

@ -8,6 +8,9 @@ Changelog
- fix: prevent raising :exc:`AttributeError` when ``--reload`` is not passed
in case of a :exc:`SyntaxError` raised from the WSGI application.
(:issue:`1805`, :pr:`1806`)
- The internal module ``gunicorn.workers.async`` was renamed to ``gunicorn.workers.base_async``
since ``async`` is now a reserved word in Python 3.7.
(:pr:`1527`)
19.8.1 / 2018/04/30
===================

View File

@ -17,6 +17,6 @@ SUPPORTED_WORKERS = {
}
if sys.version_info >= (3, 3):
# gaiohttp worker can be used with Python 3.3+ only.
if sys.version_info >= (3, 4):
# gaiohttp worker can be used with Python 3.4+ only.
SUPPORTED_WORKERS["gaiohttp"] = "gunicorn.workers.gaiohttp.AiohttpWorker"

View File

@ -46,7 +46,7 @@ class AiohttpWorker(base.Worker):
super().init_process()
def run(self):
self._runner = asyncio.async(self._run(), loop=self.loop)
self._runner = asyncio.ensure_future(self._run(), loop=self.loop)
try:
self.loop.run_until_complete(self._runner)

View File

@ -24,7 +24,7 @@ from eventlet.wsgi import ALREADY_HANDLED as EVENTLET_ALREADY_HANDLED
import greenlet
from gunicorn.http.wsgi import sendfile as o_sendfile
from gunicorn.workers.async import AsyncWorker
from gunicorn.workers.base_async import AsyncWorker
def _eventlet_sendfile(fdout, fdin, offset, nbytes):
while True:

View File

@ -27,7 +27,7 @@ from gevent import pywsgi
import gunicorn
from gunicorn.http.wsgi import base_environ
from gunicorn.workers.async import AsyncWorker
from gunicorn.workers.base_async import AsyncWorker
from gunicorn.http.wsgi import sendfile as o_sendfile
VERSION = "gevent/%s gunicorn/%s" % (gevent.__version__, gunicorn.__version__)

View File

@ -50,7 +50,7 @@ class WorkerTests(unittest.TestCase):
self.worker.loop = mock.Mock()
self.worker.run()
self.assertTrue(m_asyncio.async.called)
self.assertTrue(m_asyncio.ensure_future.called)
self.assertTrue(self.worker.loop.run_until_complete.called)
self.assertTrue(self.worker.loop.close.called)