Skip to content

Commit

Permalink
Fix a warning about unfinished task in web_protocol.py (#4415)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov authored Oct 21, 2020
1 parent d321923 commit 6319c25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/4408.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a warning about unfinished task in `web_protocol.py`
4 changes: 4 additions & 0 deletions aiohttp/web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ def connection_lost(self, exc: Optional[BaseException]) -> None:

if self._error_handler is not None:
self._error_handler.cancel()
if self._task_handler is not None:
self._task_handler.cancel()
if self._waiter is not None:
self._waiter.cancel()

self._task_handler = None

Expand Down
2 changes: 1 addition & 1 deletion tests/test_web_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ async def disconn():
writer.write(b"x")
writer.close()
await asyncio.sleep(0.1)
logger.debug.assert_called_with('Ignored premature client disconnection.')
logger.debug.assert_called_with('Ignored premature client disconnection')
assert disconnected_notified


Expand Down

0 comments on commit 6319c25

Please sign in to comment.