diff --git a/undetected_chromedriver/__init__.py b/undetected_chromedriver/__init__.py index 2139c58..3d8b872 100644 --- a/undetected_chromedriver/__init__.py +++ b/undetected_chromedriver/__init__.py @@ -782,7 +782,10 @@ 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