From 3123f6918ba18b0a3f7a89500b450f4cb15e1aee Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 22 Apr 2021 19:32:21 +1000 Subject: tests: Use .errno instead of .args[0] for OSError exceptions. Signed-off-by: Damien George --- tests/net_hosted/accept_timeout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/net_hosted/accept_timeout.py') 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() -- cgit v1.2.3