-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
Refactor ASGITransport.request() #1021
Conversation
1abaca4
to
048dd83
Compare
@@ -144,7 +148,7 @@ async def send(message: dict) -> None: | |||
try: | |||
await self.app(scope, receive, send) | |||
except Exception: | |||
if self.raise_app_exceptions or not response_complete: | |||
if self.raise_app_exceptions or not response_complete.is_set(): |
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.
I think this was a typo before.
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.
Think that was my mistake. Missed this when changing response_complete
from a bool to an event. Also didn't realise the nonlocal
could be removed 😬
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.
Looks good 👍
@@ -144,7 +148,7 @@ async def send(message: dict) -> None: | |||
try: | |||
await self.app(scope, receive, send) | |||
except Exception: | |||
if self.raise_app_exceptions or not response_complete: | |||
if self.raise_app_exceptions or not response_complete.is_set(): |
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.
Think that was my mistake. Missed this when changing response_complete
from a bool to an event. Also didn't realise the nonlocal
could be removed 😬
Prompted by #998 (comment), small bit of refactoring for
ASGITransport
to help reduce the diff there. I think these are valid readability improvements any case.typing
import style.nonlocal
's