From 83509f49c9ea3959d264c7fa8fcab96761803d75 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sat, 30 Aug 2025 17:01:48 +0200 Subject: [PATCH 1/2] communication: Separate _reset_socket() function --- executorlib/standalone/interactive/communication.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/executorlib/standalone/interactive/communication.py b/executorlib/standalone/interactive/communication.py index 4fa224ac..e92fe4f4 100644 --- a/executorlib/standalone/interactive/communication.py +++ b/executorlib/standalone/interactive/communication.py @@ -130,6 +130,13 @@ def shutdown(self, wait: bool = True): input_dict={"shutdown": True, "wait": wait} ) self._spawner.shutdown(wait=wait) + self._reset_socket() + return result + + def _reset_socket(self): + """ + Reset the socket and context of the SocketInterface instance. + """ if self._socket is not None: self._socket.close() if self._context is not None: @@ -137,7 +144,6 @@ def shutdown(self, wait: bool = True): self._process = None self._socket = None self._context = None - return result def __del__(self): """ From eb3cd95c4a8239407c3e57953306f859bb85be04 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 30 Aug 2025 15:03:07 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- executorlib/standalone/interactive/communication.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executorlib/standalone/interactive/communication.py b/executorlib/standalone/interactive/communication.py index e92fe4f4..1be6f13a 100644 --- a/executorlib/standalone/interactive/communication.py +++ b/executorlib/standalone/interactive/communication.py @@ -132,7 +132,7 @@ def shutdown(self, wait: bool = True): self._spawner.shutdown(wait=wait) self._reset_socket() return result - + def _reset_socket(self): """ Reset the socket and context of the SocketInterface instance.