Fix gaiohttp worker

This commit is contained in:
Diego Oliveira 2018-05-26 10:42:15 -03:00
parent 0a88d19ddf
commit 43e31c366b
7 changed files with 16 additions and 5 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@ examples/frameworks/pylonstest/pylonstest.egg-info/
MANIFEST
nohup.out
setuptools-*
.cache
.eggs

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

@ -2,6 +2,14 @@
Changelog
=========
19.9.0 / 2018/05/26
===================
- the internal module `gunicorn.workers.async` was renamed to `gunicorn.workers.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):
if sys.version_info >= (3, 4):
# gaiohttp worker can be used with Python 3.3+ 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

@ -1,3 +1,3 @@
coverage>=4.0,<4.4 # TODO: https://github.com/benoitc/gunicorn/issues/1548
pytest==3.0.5
pytest-cov==2.4.0
pytest
pytest-cov

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)