Call self._writer.wait_closed() on disconnect

https://docs.python.org/3/library/asyncio-stream.html#asyncio.StreamWriter.wait_closed
This commit is contained in:
Lonami Exo 2019-04-25 09:56:30 +02:00
parent 01eb49d3a4
commit 19664cd9cf

View File

@ -2,6 +2,7 @@ import abc
import asyncio
import socket
import ssl as ssl_mod
import sys
from ...errors import InvalidChecksumError
from ... import helpers
@ -108,6 +109,8 @@ class Connection(abc.ABC):
if self._writer:
self._writer.close()
if sys.version_info >= (3, 7):
await self._writer.wait_closed()
def send(self, data):
"""