mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-04 05:34:41 +03:00
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:
parent
01eb49d3a4
commit
19664cd9cf
|
@ -2,6 +2,7 @@ import abc
|
||||||
import asyncio
|
import asyncio
|
||||||
import socket
|
import socket
|
||||||
import ssl as ssl_mod
|
import ssl as ssl_mod
|
||||||
|
import sys
|
||||||
|
|
||||||
from ...errors import InvalidChecksumError
|
from ...errors import InvalidChecksumError
|
||||||
from ... import helpers
|
from ... import helpers
|
||||||
|
@ -108,6 +109,8 @@ class Connection(abc.ABC):
|
||||||
|
|
||||||
if self._writer:
|
if self._writer:
|
||||||
self._writer.close()
|
self._writer.close()
|
||||||
|
if sys.version_info >= (3, 7):
|
||||||
|
await self._writer.wait_closed()
|
||||||
|
|
||||||
def send(self, data):
|
def send(self, data):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user