mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-31 14:22:33 +00:00
Ignore errors in talk socket shutdown
macOS apparently shuts down the socket before shutdown can be called.
This commit is contained in:
parent
0848816644
commit
301d34fecf
2 changed files with 12 additions and 3 deletions
|
|
@ -540,7 +540,10 @@ class Boss:
|
|||
try:
|
||||
s.connect(address)
|
||||
s.sendall(b'c')
|
||||
s.shutdown(socket.SHUT_RDWR)
|
||||
try:
|
||||
s.shutdown(socket.SHUT_RDWR)
|
||||
except EnvironmentError:
|
||||
pass
|
||||
s.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -48,13 +48,19 @@ def talk_to_instance(args):
|
|||
|
||||
data = json.dumps(data, ensure_ascii=False).encode('utf-8')
|
||||
single_instance.socket.sendall(data)
|
||||
single_instance.socket.shutdown(socket.SHUT_RDWR)
|
||||
try:
|
||||
single_instance.socket.shutdown(socket.SHUT_RDWR)
|
||||
except EnvironmentError:
|
||||
pass
|
||||
single_instance.socket.close()
|
||||
|
||||
if args.wait_for_single_instance_window_close:
|
||||
conn = notify_socket.accept()[0]
|
||||
conn.recv(1)
|
||||
conn.shutdown(socket.SHUT_RDWR)
|
||||
try:
|
||||
conn.shutdown(socket.SHUT_RDWR)
|
||||
except EnvironmentError:
|
||||
pass
|
||||
conn.close()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue