Fix "OSError: [WinError 6] The handle is invalid" on exit

This commit is contained in:
ilike2burnthing
2023-11-13 04:28:19 +00:00
committed by GitHub
parent 04858c22fd
commit 3fa9631559

View File

@@ -811,7 +811,11 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
else:
logger.debug("successfully removed %s" % self.user_data_dir)
break
time.sleep(0.1)
try:
time.sleep(0.1)
except OSError:
pass
# dereference patcher, so patcher can start cleaning up as well.
# this must come last, otherwise it will throw 'in use' errors