Skip to content

Commit deb2a5f

Browse files
authored
Merge pull request #206 from justmobilize/remove-timeout-exception
Remove timeout Exception
2 parents 098c0b3 + b160267 commit deb2a5f

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

adafruit_esp32spi/adafruit_esp32spi_socketpool.py

+2-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
pass
2222

2323

24+
import errno
2425
import time
2526
import gc
2627
from micropython import const
@@ -181,7 +182,7 @@ def recv_into(self, buffer, nbytes: int = 0):
181182
break
182183
# No bytes yet, or more bytes requested.
183184
if self._timeout > 0 and time.monotonic() - last_read_time > self._timeout:
184-
raise timeout("timed out")
185+
raise OSError(errno.ETIMEDOUT)
185186
return num_read
186187

187188
def settimeout(self, value):
@@ -223,11 +224,3 @@ def _connected(self):
223224
def close(self):
224225
"""Close the socket, after reading whatever remains"""
225226
self._interface.socket_close(self._socknum)
226-
227-
228-
class timeout(TimeoutError): # pylint: disable=invalid-name
229-
"""TimeoutError class. An instance of this error will be raised by recv_into() if
230-
the timeout has elapsed and we haven't received any data yet."""
231-
232-
def __init__(self, msg):
233-
super().__init__(msg)

0 commit comments

Comments
 (0)