Skip to content

Commit 7a94059

Browse files
committed
Add a retry on failure for driver downloads
1 parent 1b1e4d6 commit 7a94059

File tree

1 file changed

+12
-1
lines changed
  • seleniumbase/console_scripts

1 file changed

+12
-1
lines changed

seleniumbase/console_scripts/run.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,17 +953,28 @@ def main():
953953
from seleniumbase.console_scripts import sb_install
954954

955955
need_retry = False
956+
need_another_retry = False
957+
retry_msg = "Unable to download driver! Retrying in 3 seconds..."
956958
try:
957959
sb_install.main()
958960
except Exception as e:
959961
invalid_run_cmd = constants.Warnings.INVALID_RUN_COMMAND
960962
if invalid_run_cmd in str(e):
961963
raise
962-
print("\nDriver download failed! Retrying in 3 seconds...")
964+
print()
965+
print(retry_msg)
963966
time.sleep(3)
964967
print()
965968
need_retry = True
966969
if need_retry:
970+
try:
971+
sb_install.main()
972+
except Exception:
973+
print(retry_msg)
974+
time.sleep(3)
975+
print()
976+
need_another_retry = True
977+
if need_another_retry:
967978
sb_install.main()
968979
else:
969980
show_basic_usage()

0 commit comments

Comments
 (0)