Skip to content

Commit b757099

Browse files
committed
Fix unstable test
1 parent 4b4958a commit b757099

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_tcp.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -2478,8 +2478,13 @@ def server(sock):
24782478

24792479
# send close_notify but don't wait for response
24802480
sock.setblocking(0)
2481-
with self.assertRaises(ssl.SSLWantReadError):
2482-
sock.unwrap()
2481+
try:
2482+
with self.assertRaises(ssl.SSLWantReadError):
2483+
sock.unwrap()
2484+
except OSError as ex:
2485+
# sometimes the network is faster
2486+
if ex.errno != 0:
2487+
raise
24832488
sock.setblocking(1)
24842489

24852490
# should receive all data

0 commit comments

Comments
 (0)