From 75beb09f2ec80ae2fef9684db0d26d457f2317c1 Mon Sep 17 00:00:00 2001 From: emontnemery Date: Thu, 13 Jul 2017 15:00:16 +0200 Subject: [PATCH] Fix send message deadlock (#180) * Fix deadlock in SocketClient.send_message * Fix for #179 --- pychromecast/socket_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pychromecast/socket_client.py b/pychromecast/socket_client.py index 2e2e2bd98..3bfd3af9b 100644 --- a/pychromecast/socket_client.py +++ b/pychromecast/socket_client.py @@ -590,7 +590,7 @@ def send_message(self, destination_id, namespace, data, } self.socket.sendall(be_size + msg.SerializeToString()) except socket.error: - del self._request_callbacks[request_id] + self._request_callbacks.pop(request_id, None) self._force_recon = True self.logger.info('Error writing to socket.') else: