mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Fix unhandled exception in case the connection is already closed
This commit is contained in:
parent
316c426429
commit
dde01cc9b9
1 changed files with 6 additions and 2 deletions
|
|
@ -33,7 +33,11 @@ class TCP(socket.socket):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
try:
|
||||||
self.shutdown(socket.SHUT_RDWR)
|
self.shutdown(socket.SHUT_RDWR)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
|
finally:
|
||||||
super().close()
|
super().close()
|
||||||
|
|
||||||
def recvall(self, length: int) -> bytes or None:
|
def recvall(self, length: int) -> bytes or None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue