Skip to content

Remove timeout Exception #206

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

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
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)
Loading