macOS: Fix an error in remote control when using --listen-on. Fixes #679

This commit is contained in:
Kovid Goyal 2018-06-25 12:33:54 +05:30
parent 2491fafe98
commit 8bfdc47998
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -58,7 +58,10 @@ class SocketIO:
def __exit__(self, *a):
import socket
self.socket.shutdown(socket.SHUT_RDWR)
try:
self.socket.shutdown(socket.SHUT_RDWR)
except EnvironmentError:
pass # on some OSes such as macOS the socket is already closed at this point
self.socket.close()
def send(self, data):