Skip to content

Commit 66ffd0b

Browse files
authored
Merge pull request #163 from justmobilize/remove-timeout-exception
Remove timeout Exception
2 parents 09b83c4 + 606dc4f commit 66ffd0b

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

adafruit_wiznet5k/adafruit_wiznet5k_socketpool.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
except ImportError:
2222
pass
2323

24+
import errno
2425
import gc
2526
from sys import byteorder
26-
from errno import ETIMEDOUT
2727

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

644644
@_check_socket_closed
@@ -813,11 +813,3 @@ def type(self):
813813
def proto(self):
814814
"""Socket protocol (always 0x00 in this implementation)."""
815815
return 0
816-
817-
818-
class timeout(TimeoutError): # pylint: disable=invalid-name
819-
"""TimeoutError class. An instance of this error will be raised by recv_into() if
820-
the timeout has elapsed and we haven't received any data yet."""
821-
822-
def __init__(self, msg):
823-
super().__init__(ETIMEDOUT, msg)

0 commit comments

Comments
 (0)