Skip to content

Commit 5530fb5

Browse files
communication: Separate _reset_socket() function (#792)
* communication: Separate _reset_socket() function * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 45d5048 commit 5530fb5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

executorlib/standalone/interactive/communication.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,20 @@ def shutdown(self, wait: bool = True):
130130
input_dict={"shutdown": True, "wait": wait}
131131
)
132132
self._spawner.shutdown(wait=wait)
133+
self._reset_socket()
134+
return result
135+
136+
def _reset_socket(self):
137+
"""
138+
Reset the socket and context of the SocketInterface instance.
139+
"""
133140
if self._socket is not None:
134141
self._socket.close()
135142
if self._context is not None:
136143
self._context.term()
137144
self._process = None
138145
self._socket = None
139146
self._context = None
140-
return result
141147

142148
def __del__(self):
143149
"""

0 commit comments

Comments
 (0)