Skip to content

Commit eb19349

Browse files
committed
service: move process termination to finally block
If a type error or similar occurs during send_remote_shutdown_command, one should always terminate the service process, even if an exception is thrown. Thus moving self._terminate_process() into a finally block. Signed-off-by: Sandro Pischinger <[email protected]>
1 parent 7ed046c commit eb19349

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

py/selenium/webdriver/common/service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ def stop(self) -> None:
157157
self.send_remote_shutdown_command()
158158
except TypeError:
159159
pass
160-
self._terminate_process()
160+
finally:
161+
self._terminate_process()
161162

162163
def _terminate_process(self) -> None:
163164
"""Terminate the child process.

0 commit comments

Comments
 (0)