Skip to content

Commit

Permalink
Merge pull request #206 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 098c0b3 + b160267 commit deb2a5f
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions adafruit_esp32spi/adafruit_esp32spi_socketpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
pass


import errno
import time
import gc
from micropython import const
Expand Down Expand Up @@ -181,7 +182,7 @@ def recv_into(self, buffer, nbytes: int = 0):
break
# No bytes yet, or more bytes requested.
if self._timeout > 0 and time.monotonic() - last_read_time > self._timeout:
raise timeout("timed out")
raise OSError(errno.ETIMEDOUT)
return num_read

def settimeout(self, value):
Expand Down Expand Up @@ -223,11 +224,3 @@ def _connected(self):
def close(self):
"""Close the socket, after reading whatever remains"""
self._interface.socket_close(self._socknum)


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__(msg)

0 comments on commit deb2a5f

Please sign in to comment.