From 8bfdc47998ea60058a838668934545143f0628ed Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 25 Jun 2018 12:33:54 +0530 Subject: [PATCH] macOS: Fix an error in remote control when using --listen-on. Fixes #679 --- kitty/remote_control.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/remote_control.py b/kitty/remote_control.py index 1ed56ec0f..bc12f0d18 100644 --- a/kitty/remote_control.py +++ b/kitty/remote_control.py @@ -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):