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
Conversation
simpler code to handle asyncio installation just test the version in the module. fix #830
if sys.version_info >= (3, 3): | ||
import asyncio | ||
else: | ||
RuntimeError("You need Python >= 3.3 to use the asyncio worker") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the raise?
Looks good after you fix the missing raise that @matrixise pointed out. |
make sure we raise here.
Needs rebase. |
if sys.version_info >= (3, 3): | ||
import asyncio | ||
else: | ||
raise RuntimeError("You need Python >= 3.3 to use the asyncio worker") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be raised in Python 2 because of the yield from
usages. Here's an alternative patch: https://gist.github.com/berkerpeksag/7a5091a7b7944dc9e9c2
With the new patch:
>>> from gunicorn.workers import gaiohttp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gunicorn/workers/gaiohttp.py", line 13, in <module>
raise RuntimeError("You need Python >= 3.3 to use the asyncio worker")
RuntimeError: You need Python >= 3.3 to use the asyncio worker
With #831:
>>> from gunicorn.workers import gaiohttp
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gunicorn/workers/gaiohttp.py", line 79
yield from self.wsgi.close()
^
SyntaxError: invalid syntax
I can open a new pull request if this approach is good enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds can you open a PR with your patch? Will test it in the day :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: #846.
related changes in master |
I deleted the branch. I hope that's okay, @benoitc |
simpler code to handle asyncio installation just test the version in the module.
fix #830