Skip to content

Commit

Permalink
Refactor: IOError was deprecated. Replace with OSError #457
Browse files Browse the repository at this point in the history
  • Loading branch information
farisachugthai committed Sep 2, 2020
1 parent a5446ce commit 1276622
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pynvim/api/nvim.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def quit(self, quit_command='qa!'):
"""
try:
self.command(quit_command)
except IOError:
except OSError:
# sending a quit command will raise an IOError because the
# connection is closed before a response is received. Safe to
# ignore it.
Expand Down
2 changes: 1 addition & 1 deletion pynvim/msgpack_rpc/event_loop/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _on_signal(self, signum):

def _on_error(self, error):
debug(error)
self._error = IOError(error)
self._error = OSError(error)
self.stop()

def _on_interrupt(self):
Expand Down
4 changes: 2 additions & 2 deletions pynvim/msgpack_rpc/event_loop/uv.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _on_connect(self, stream, error):
if error:
msg = 'Cannot connect to {}: {}'.format(
self._connect_address, pyuv.errno.strerror(error))
self._connection_error = IOError(msg)
self._connection_error = OSError(msg)
return
self._read_stream = self._write_stream = stream

Expand All @@ -45,7 +45,7 @@ def _on_exit(self, handle, exit_status, term_signal):
self._on_error('EOF')

def _disconnected(self, *args):
raise IOError('Not connected to Nvim')
raise OSError('Not connected to Nvim')

def _connect_tcp(self, address, port):
stream = pyuv.TCP(self._loop)
Expand Down
2 changes: 1 addition & 1 deletion pynvim/msgpack_rpc/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def request(self, method, *args, **kwargs):
v = self._blocking_request(method, args)
if not v:
# EOF
raise IOError('EOF')
raise OSError('EOF')
err, rv = v
if err:
info("'Received error: %s", err)
Expand Down
2 changes: 1 addition & 1 deletion scripts/logging_statement_modifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def main(argv=sys.argv[1:]):
return modify_logging(input_fn, options.output_file,
min_level_value, max_level_value,
options.restore, options.force)
except IOError as e:
except OSError as e:
logging.error(str(e))
return -1

Expand Down

0 comments on commit 1276622

Please sign in to comment.