Skip to content

Commit e26e817

Browse files
committed
add EWOULDBLOCK as argument in WantRead/WantWrite error exceptions
1 parent 25fc942 commit e26e817

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/wolfssl/exceptions.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
# pylint: disable=missing-docstring
2424

25-
from socket import error as socket_error
25+
from socket import error as socket_error, EWOULDBLOCK
2626

2727

2828
class SSLError(socket_error):
@@ -52,6 +52,11 @@ class SSLWantReadError(SSLError):
5252
read or write data, but more data needs to be received on the underlying
5353
TCP transport before the request can be fulfilled.
5454
"""
55+
def __init__(self):
56+
self.code = EWOULDBLOCK
57+
self.msg = "Socket would read block"
58+
self.args = (self.code, self.msg)
59+
5560
pass
5661

5762

@@ -61,6 +66,11 @@ class SSLWantWriteError(SSLError):
6166
read or write data, but more data needs to be sent on the underlying TCP
6267
transport before the request can be fulfilled.
6368
"""
69+
def __init__(self):
70+
self.code = EWOULDBLOCK
71+
self.msg = "Socket would write block"
72+
self.args = (self.code, self.msg)
73+
6474
pass
6575

6676

0 commit comments

Comments
 (0)