Skip to content

Commit dafb42b

Browse files
committed
Handle the new zip format for edgedriver packaging
1 parent f322d1c commit dafb42b

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

seleniumbase/console_scripts/sb_install.py

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,19 @@ def main(override=None):
410410
print("")
411411
elif name == "edgedriver" or name == "msedgedriver":
412412
if "darwin" in sys_plat or "linux" in sys_plat:
413-
# Was expecting to be on a Windows OS at this point
414-
raise Exception("Unexpected file format for msedgedriver!")
415-
expected_contents = (['Driver_Notes/',
416-
'Driver_Notes/credits.html',
417-
'Driver_Notes/LICENSE',
418-
'msedgedriver.exe'])
419-
if len(contents) > 4:
413+
# Mac / Linux
414+
expected_contents = (['Driver_Notes/',
415+
'Driver_Notes/LICENSE',
416+
'Driver_Notes/credits.html',
417+
'msedgedriver',
418+
'libc++.dylib'])
419+
else:
420+
# Windows
421+
expected_contents = (['Driver_Notes/',
422+
'Driver_Notes/credits.html',
423+
'Driver_Notes/LICENSE',
424+
'msedgedriver.exe'])
425+
if len(contents) > 5:
420426
raise Exception("Unexpected content in EdgeDriver Zip file!")
421427
for content in contents:
422428
if content not in expected_contents:
@@ -430,11 +436,20 @@ def main(override=None):
430436
# Remove existing version if exists
431437
str_name = str(f_name)
432438
new_file = downloads_folder + '/' + str_name
433-
if str_name == "msedgedriver.exe":
434-
driver_file = str_name
435-
driver_path = new_file
436-
if os.path.exists(new_file):
437-
os.remove(new_file)
439+
if "darwin" in sys_plat or "linux" in sys_plat:
440+
# Mac / Linux
441+
if str_name == "msedgedriver":
442+
driver_file = str_name
443+
driver_path = new_file
444+
if os.path.exists(new_file):
445+
os.remove(new_file)
446+
else:
447+
# Windows
448+
if str_name == "msedgedriver.exe":
449+
driver_file = str_name
450+
driver_path = new_file
451+
if os.path.exists(new_file):
452+
os.remove(new_file)
438453
if not driver_file or not driver_path:
439454
raise Exception("msedgedriver missing from Zip file!")
440455
print('Extracting %s from %s ...' % (contents, file_name))

0 commit comments

Comments
 (0)