summaryrefslogtreecommitdiffstatshomepage
path: root/tests/net_hosted
diff options
context:
space:
mode:
Diffstat (limited to 'tests/net_hosted')
-rw-r--r--tests/net_hosted/accept_nonblock.py2
-rw-r--r--tests/net_hosted/accept_timeout.py2
-rw-r--r--tests/net_hosted/connect_nonblock.py2
-rw-r--r--tests/net_hosted/connect_nonblock_xfer.py10
4 files changed, 8 insertions, 8 deletions
diff --git a/tests/net_hosted/accept_nonblock.py b/tests/net_hosted/accept_nonblock.py
index 941965e178..d17e287498 100644
--- a/tests/net_hosted/accept_nonblock.py
+++ b/tests/net_hosted/accept_nonblock.py
@@ -12,5 +12,5 @@ s.listen(1)
try:
s.accept()
except OSError as er:
- print(er.args[0] == 11) # 11 is EAGAIN
+ print(er.errno == 11) # 11 is EAGAIN
s.close()
diff --git a/tests/net_hosted/accept_timeout.py b/tests/net_hosted/accept_timeout.py
index 5f528d557d..734fe217ca 100644
--- a/tests/net_hosted/accept_timeout.py
+++ b/tests/net_hosted/accept_timeout.py
@@ -18,5 +18,5 @@ s.listen(1)
try:
s.accept()
except OSError as er:
- print(er.args[0] in (errno.ETIMEDOUT, "timed out")) # CPython uses a string instead of errno
+ print(er.errno in (errno.ETIMEDOUT, "timed out")) # CPython uses a string instead of errno
s.close()
diff --git a/tests/net_hosted/connect_nonblock.py b/tests/net_hosted/connect_nonblock.py
index c024b65a0a..4b8055c161 100644
--- a/tests/net_hosted/connect_nonblock.py
+++ b/tests/net_hosted/connect_nonblock.py
@@ -13,7 +13,7 @@ def test(peer_addr):
try:
s.connect(peer_addr)
except OSError as er:
- print(er.args[0] == errno.EINPROGRESS)
+ print(er.errno == errno.EINPROGRESS)
s.close()
diff --git a/tests/net_hosted/connect_nonblock_xfer.py b/tests/net_hosted/connect_nonblock_xfer.py
index feb648ea0a..1a0b242276 100644
--- a/tests/net_hosted/connect_nonblock_xfer.py
+++ b/tests/net_hosted/connect_nonblock_xfer.py
@@ -25,9 +25,9 @@ def do_connect(peer_addr, tls, handshake):
# print("Connecting to", peer_addr)
s.connect(peer_addr)
except OSError as er:
- print("connect:", er.args[0] == errno.EINPROGRESS)
- if er.args[0] != errno.EINPROGRESS:
- print(" got", er.args[0])
+ print("connect:", er.errno == errno.EINPROGRESS)
+ if er.errno != errno.EINPROGRESS:
+ print(" got", er.errno)
# wrap with ssl/tls if desired
if tls:
try:
@@ -67,7 +67,7 @@ def test(peer_addr, tls=False, handshake=False):
except OSError as er:
#
dp(er)
- print("send:", er.args[0] in (errno.EAGAIN, errno.EINPROGRESS))
+ print("send:", er.errno in (errno.EAGAIN, errno.EINPROGRESS))
s.close()
else: # fake it...
print("connect:", True)
@@ -103,7 +103,7 @@ def test(peer_addr, tls=False, handshake=False):
print("recv:", s.recv(10))
except OSError as er:
dp(er)
- print("recv:", er.args[0] == errno.EAGAIN)
+ print("recv:", er.errno == errno.EAGAIN)
s.close()
else: # fake it...
print("connect:", True)