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

fix asyncio worker handling #831

wants to merge 2 commits into from

Conversation

benoitc
Copy link
Owner

@benoitc benoitc commented Jul 28, 2014

simpler code to handle asyncio installation just test the version in the module.

fix #830

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")
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?

@tilgovi
Copy link
Collaborator

tilgovi commented Jul 28, 2014

Looks good after you fix the missing raise that @matrixise pointed out.

make sure we raise here.
@tilgovi
Copy link
Collaborator

tilgovi commented Aug 5, 2014

Needs rebase.

if sys.version_info >= (3, 3):
import asyncio
else:
raise 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.

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.

Copy link
Owner Author

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 :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Done: #846.

@benoitc
Copy link
Owner Author

benoitc commented Aug 18, 2014

related changes in master

@benoitc benoitc closed this Aug 18, 2014
@tilgovi tilgovi deleted the fix/830 branch August 18, 2014 23:03
@tilgovi
Copy link
Collaborator

tilgovi commented Aug 18, 2014

I deleted the branch. I hope that's okay, @benoitc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gaiohttp worker not available in gunicorn 19.1.0
4 participants