Skip to content

Commit

Permalink
error: InvalidTypeError -> ArgumentError
Browse files Browse the repository at this point in the history
  • Loading branch information
koehlma committed Feb 9, 2016
1 parent d7bb062 commit c4fc761
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion tests/test_fs_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ def test_closed(self):
def test_path_none(self):
self.fs_event = uv.FSEvent()

self.assert_raises(uv.error.InvalidTypeError, self.fs_event.start)
self.assert_raises(uv.error.ArgumentError, self.fs_event.start)
2 changes: 1 addition & 1 deletion tests/test_fs_poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ def test_closed(self):
def test_path_none(self):
self.fs_poll = uv.FSPoll()

self.assert_raises(uv.error.InvalidTypeError, self.fs_poll.start)
self.assert_raises(uv.error.ArgumentError, self.fs_poll.start)
4 changes: 0 additions & 4 deletions uv/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,6 @@ class _DummyClass(object):


@StatusCodes.EINVAL
class InvalidTypeError(UVError, TypeError):
""" Invalid argument type. """


@StatusCodes.E2BIG
@StatusCodes.EAI_OVERFLOW
@StatusCodes.EFAULT
Expand Down
6 changes: 3 additions & 3 deletions uv/handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def send_buffer_size(self):
socket. The following handles are supported: TCP and UDP
handles on Unix and Windows, Pipe handles only on Unix. On all
unsupported handles this will raise :class:`uv.UVError` with
error code `EINVAL` (:class:`uv.error.InvalidTypeError`).
error code `EINVAL` (:class:`uv.error.ArgumentError`).
.. note::
Unlike libuv this library abstracts the different
Expand Down Expand Up @@ -311,7 +311,7 @@ def receive_buffer_size(self):
the socket. The following handles are supported: TCP and UDP
handles on Unix and Windows, Pipe handles only on Unix. On all
unsupported handles this will raise :class:`uv.UVError` with
error code `EINVAL` (:class:`uv.error.InvalidTypeError`).
error code `EINVAL` (:class:`uv.error.ArgumentError`).
.. note::
Unlike libuv this library abstracts the different
Expand Down Expand Up @@ -363,7 +363,7 @@ def fileno(self):
Get the platform dependent file descriptor equivalent. The
following handles are supported: TCP, UDP, TTY, Pipes and Poll.
On all other handles this will raise :class:`uv.UVError` with
error code `EINVAL` (:class:`uv.error.InvalidTypeError`).
error code `EINVAL` (:class:`uv.error.ArgumentError`).
If a handle does not have an attached file descriptor yet this
method will raise :class:`uv.UVError` with error code `EBADF`
Expand Down
2 changes: 1 addition & 1 deletion uv/handles/fs_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def start(self, path=None, flags=None, on_event=None):
self.flags = flags or self.flags
self.on_event = on_event or self.on_event
if self.path is None:
raise error.InvalidTypeError(message='no path has been specified')
raise error.ArgumentError(message='no path has been specified')
c_path = self.path.encode()
code = lib.uv_fs_event_start(self.uv_fs_event, uv_fs_event_cb, c_path, self.flags)
if code != error.StatusCodes.SUCCESS:
Expand Down
2 changes: 1 addition & 1 deletion uv/handles/fs_poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def start(self, path=None, interval=None, on_change=None):
self.interval = interval or self.interval
self.on_change = on_change or self.on_change
if self.path is None:
raise error.InvalidTypeError(message='no path has been specified')
raise error.ArgumentError(message='no path has been specified')
c_path = self.path.encode()
code = lib.uv_fs_poll_start(self.uv_fs_poll, uv_fs_poll_cb, c_path, self.interval)
if code != error.StatusCodes.SUCCESS:
Expand Down
2 changes: 1 addition & 1 deletion uv/handles/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def populate_stdio_container(uv_stdio, file_base=None):
except AttributeError:
uv_stdio.flags = StandardIOFlags.IGNORE
if file_base is not None:
raise error.InvalidTypeError(message='unknown file object type')
raise error.ArgumentError(message='unknown file object type')
return fileobj


Expand Down
2 changes: 1 addition & 1 deletion uv/handles/timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def again(self):
"""
Stop the timer, and if it is repeating restart it using the
repeat value as the timeout. If the timer has never been
started before it raises :class:`uv.error.InvalidTypeError`.
started before it raises :class:`uv.error.ArgumentError`.
:raises uv.UVError:
error while restarting the timer
Expand Down

0 comments on commit c4fc761

Please sign in to comment.