mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-22 00:08:04 +02:00
Replace all instances of EnvironmentError with OSError
According to the text just above https://docs.python.org/3/library/exceptions.html#EnvironmentError, `EnvironmentError` has been an alias of `OSError` since Python 3.3. Replacing it makes the code more consistent since `OSError` is used in other places in the code too.
This commit is contained in:
@@ -67,14 +67,14 @@ def talk_to_instance(args):
|
||||
|
||||
data = json.dumps(data, ensure_ascii=False).encode('utf-8')
|
||||
single_instance.socket.sendall(data)
|
||||
with suppress(EnvironmentError):
|
||||
with suppress(OSError):
|
||||
single_instance.socket.shutdown(socket.SHUT_RDWR)
|
||||
single_instance.socket.close()
|
||||
|
||||
if args.wait_for_single_instance_window_close:
|
||||
conn = notify_socket.accept()[0]
|
||||
conn.recv(1)
|
||||
with suppress(EnvironmentError):
|
||||
with suppress(OSError):
|
||||
conn.shutdown(socket.SHUT_RDWR)
|
||||
conn.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user