-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch async_to_sync type error to a warning
Detecting if a function is async in Python has a lot of false negatives, so this is a lot safer while async code we call all makes sure it has the coroutinefunction flag set.
- Loading branch information
1 parent
07bffa4
commit d0ce78b
Showing
2 changed files
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d0ce78b
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.
Was there any particular case that came up after 3.3.3 that lead to this downgrade? Since it looked to me like #252 fixed the known problems.
d0ce78b
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.
Yes, Daphne was using a lambda as an awaitable for
send
rather than a partial, so anyone running it still got the error. A patch is in the works to make it a partial and then maybe we can reintroduce the error.d0ce78b
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.
Indeed, it's @adamchainz's patch. 😀
(I am a bit concerned they'll be other cases come up ... — but that's not based on much beyond a general aversion to changing anything ever. 🙂)
d0ce78b
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 plan to leave it as a warning for a bit longer, I think. Just to make sure it's not popping up everywhere.
d0ce78b
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 that's wise. Super.