Fixed win 6 error when time.sleep(0.1)
This commit is contained in:
parent
bf7dcf8b57
commit
3a1b860866
|
@ -740,7 +740,13 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
|
|||
else:
|
||||
logger.debug("successfully removed %s" % self.user_data_dir)
|
||||
break
|
||||
try:
|
||||
time.sleep(0.1)
|
||||
except (RuntimeError, OSError, PermissionError) as e:
|
||||
logger.debug(
|
||||
"When trying 'time.sleep(0.1)', a %s occured: %s\nretrying..."
|
||||
% (e.__class__.__name__, e)
|
||||
)
|
||||
|
||||
# dereference patcher, so patcher can start cleaning up as well.
|
||||
# this must come last, otherwise it will throw 'in use' errors
|
||||
|
|
|
@ -12,6 +12,8 @@ from typing import Callable
|
|||
from typing import List
|
||||
from typing import Optional
|
||||
|
||||
logger = logging.getLogger("uc")
|
||||
logger.setLevel(logging.getLogger().getEffectiveLevel())
|
||||
|
||||
class Structure(dict):
|
||||
"""
|
||||
|
@ -162,7 +164,13 @@ def test():
|
|||
"func called! %s (args: %s, kwargs: %s)" % (fn.__name__, args, kwargs)
|
||||
)
|
||||
while driver.service.process and driver.service.process.poll() is not None:
|
||||
try:
|
||||
time.sleep(0.1)
|
||||
except (RuntimeError, OSError, PermissionError) as e:
|
||||
logger.debug(
|
||||
"When trying 'time.sleep(0.1)', a %s occured: %s\nretrying..."
|
||||
% (e.__class__.__name__, e)
|
||||
)
|
||||
res = fn(*args, **kwargs)
|
||||
print("func completed! (result: %s)" % res)
|
||||
return res
|
||||
|
|
|
@ -268,8 +268,11 @@ class Patcher(object):
|
|||
os.unlink(self.executable_path)
|
||||
logger.debug("successfully unlinked %s" % self.executable_path)
|
||||
break
|
||||
except (OSError, RuntimeError, PermissionError):
|
||||
time.sleep(0.1)
|
||||
except (OSError, RuntimeError, PermissionError) as e:
|
||||
logger.debug(
|
||||
"When trying 'time.sleep(0.1)', a %s occured: %s\nretrying..."
|
||||
% (e.__class__.__name__, e)
|
||||
)
|
||||
continue
|
||||
except FileNotFoundError:
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue