From be2c66a5f58f04b5ecfd7b07875926a8a60bcb62 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 2 Mar 2016 14:28:04 -0800 Subject: [PATCH] transit: ignore errors on sockets we were about to close anyways --- src/wormhole/blocking/transit.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wormhole/blocking/transit.py b/src/wormhole/blocking/transit.py index 800b7dc..42a334a 100644 --- a/src/wormhole/blocking/transit.py +++ b/src/wormhole/blocking/transit.py @@ -371,7 +371,13 @@ class Common: self.winning.set() else: if self.is_sender: - send_to(skt, b"nevermind\n") + try: + send_to(skt, b"nevermind\n") + except socket.error: + # They realized this connection is not going to win, and + # closed it so fast we didn't get a chance to tell them + # it lost. This happens in unit tests. + pass skt.close() def connect(self):