mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
extmod/modussl: Fix ussl read/recv/send/write errors when non-blocking.
Also fix related problems with socket on esp32, improve docs for wrap_socket, and add more tests.
This commit is contained in:
committed by
Damien George
parent
2eed9780ba
commit
2c1299b007
@@ -1,9 +1,9 @@
|
||||
# test that socket.accept() on a socket with timeout raises ETIMEDOUT
|
||||
|
||||
try:
|
||||
import usocket as socket
|
||||
import uerrno as errno, usocket as socket
|
||||
except:
|
||||
import socket
|
||||
import errno, socket
|
||||
|
||||
try:
|
||||
socket.socket.settimeout
|
||||
@@ -18,5 +18,5 @@ s.listen(1)
|
||||
try:
|
||||
s.accept()
|
||||
except OSError as er:
|
||||
print(er.args[0] in (110, "timed out")) # 110 is ETIMEDOUT; CPython uses a string
|
||||
print(er.args[0] in (errno.ETIMEDOUT, "timed out")) # CPython uses a string instead of errno
|
||||
s.close()
|
||||
|
||||
Reference in New Issue
Block a user