File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
py/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -190,6 +190,13 @@ def _terminate_process(self) -> None:
190190 logger .error ("Error terminating service process." , exc_info = True )
191191
192192 def __del__ (self ) -> None :
193+ """Cleanup and terminate the service process when the object is destroyed.
194+
195+ Attempts to gracefully stop the service process when the instance is
196+ garbage collected. `subprocess.Popen` doesn't send signals on `__del__`,
197+ so we explicitly call stop() here. Note: globals are not referenced here
198+ as they may be None during interpreter shutdown.
199+ """
193200 # `subprocess.Popen` doesn't send signal on `__del__`;
194201 # so we attempt to close the launched process when `__del__`
195202 # is triggered.
You can’t perform that action at this time.
0 commit comments