mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 13:14:31 +03:00
Ignore EBADF when closing the socket
This commit is contained in:
parent
68cdc9eaf1
commit
626778bd32
|
@ -56,9 +56,8 @@ class TcpClient:
|
|||
if self.connected:
|
||||
self._socket.shutdown(socket.SHUT_RDWR)
|
||||
self._socket.close()
|
||||
except OSError as e:
|
||||
if e.errno != errno.ENOTCONN:
|
||||
raise
|
||||
except OSError:
|
||||
pass # Ignore ENOTCONN, EBADF, and any other error when closing
|
||||
finally:
|
||||
self._socket = None
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user