mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-28 00:56:19 +00:00
Fix unhandled exception in case the connection is already closed
This commit is contained in:
parent
316c426429
commit
dde01cc9b9
@ -33,8 +33,12 @@ class TCP(socket.socket):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
self.shutdown(socket.SHUT_RDWR)
|
try:
|
||||||
super().close()
|
self.shutdown(socket.SHUT_RDWR)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
|
super().close()
|
||||||
|
|
||||||
def recvall(self, length: int) -> bytes or None:
|
def recvall(self, length: int) -> bytes or None:
|
||||||
data = b""
|
data = b""
|
||||||
|
Loading…
Reference in New Issue
Block a user