From b812a61bd518ea1a0a7c733b4e7f1ed8368a2201 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Wed, 31 Mar 2021 16:27:11 +0800 Subject: [PATCH] fix race in integration test --- meshtastic/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index b19d3ca..d7fc76f 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -1204,7 +1204,10 @@ class TCPInterface(StreamInterface): # the socket here self._wantExit = True if not self.socket is None: - self.socket.shutdown(socket.SHUT_RDWR) + try: + self.socket.shutdown(socket.SHUT_RDWR) + except: + pass # Ignore errors in shutdown, because we might have a race with the server self.socket.close() def _writeBytes(self, b):