Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove timeout Exception #163

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
except ImportError:
pass

import errno
import gc
from sys import byteorder
from errno import ETIMEDOUT

from micropython import const
from adafruit_ticks import ticks_ms, ticks_diff
Expand Down Expand Up @@ -638,7 +638,7 @@ def recv_into( # pylint: disable=unused-argument
# non-blocking mode
break
if ticks_diff(ticks_ms(), last_read_time) / 1000 > self._timeout:
raise timeout("timed out")
raise OSError(errno.ETIMEDOUT)
return num_read

@_check_socket_closed
Expand Down Expand Up @@ -813,11 +813,3 @@ def type(self):
def proto(self):
"""Socket protocol (always 0x00 in this implementation)."""
return 0


class timeout(TimeoutError): # pylint: disable=invalid-name
"""TimeoutError class. An instance of this error will be raised by recv_into() if
the timeout has elapsed and we haven't received any data yet."""

def __init__(self, msg):
super().__init__(ETIMEDOUT, msg)
Loading