Skip to content

Commit

Permalink
Fix typing check
Browse files Browse the repository at this point in the history
  • Loading branch information
ChihweiLHBird committed Dec 3, 2021
1 parent 58b3613 commit e4b53a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sanic/response.py
Expand Up @@ -121,10 +121,13 @@ async def send(
if end_stream and not data:
return
if self.stream.stage is Stage.IDLE:
raise ResponseException(
msg = (
"Response stream was ended, no more response data is "
"allowed to be sent."
)
else:
msg = "Send response function is not available."
raise ResponseException(msg)
data = (
data.encode() # type: ignore
if hasattr(data, "encode")
Expand Down

0 comments on commit e4b53a0

Please sign in to comment.