Skip to content

Commit

Permalink
Merge pull request #163 from justmobilize/remove-timeout-exception
Browse files Browse the repository at this point in the history
Remove timeout Exception
  • Loading branch information
dhalbert authored May 21, 2024
2 parents 09b83c4 + 606dc4f commit 66ffd0b
Showing 1 changed file with 2 additions and 10 deletions.
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)

0 comments on commit 66ffd0b

Please sign in to comment.