From 6f5c471ea51e4cd3d5cdcb4ba2a5131b98bd7642 Mon Sep 17 00:00:00 2001 From: Alexander Borzunov Date: Sat, 22 Jul 2023 21:11:01 +0400 Subject: [PATCH] Fix TypeError in P2P._terminate() (#579) Fix https://github.com/bigscience-workshop/petals/issues/237, https://github.com/bigscience-workshop/petals/issues/368#issuecomment-1646603710. --- hivemind/p2p/p2p_daemon.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hivemind/p2p/p2p_daemon.py b/hivemind/p2p/p2p_daemon.py index 498ec42ed..4acea4d72 100644 --- a/hivemind/p2p/p2p_daemon.py +++ b/hivemind/p2p/p2p_daemon.py @@ -658,9 +658,9 @@ def _terminate(self) -> None: self._child.terminate() logger.debug(f"Terminated p2pd with id = {self.peer_id}") - with suppress(FileNotFoundError): + with suppress(FileNotFoundError, TypeError): os.remove(self._daemon_listen_maddr["unix"]) - with suppress(FileNotFoundError): + with suppress(FileNotFoundError, TypeError): os.remove(self._client_listen_maddr["unix"]) @staticmethod