File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
py/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -39,23 +39,31 @@ def get_binary() -> Path:
39
39
"""Determines the path of the correct Selenium Manager binary.
40
40
41
41
:Returns: The Selenium Manager executable location
42
+ :Raises: WebDriverException if the platform is unsupported
42
43
"""
43
44
44
45
if (path := os .getenv ("SE_MANAGER_PATH" )) is not None :
45
46
return Path (path )
46
- else :
47
- platform = sys .platform
48
47
49
- dirs = {
50
- "darwin" : "macos" ,
51
- "win32" : "windows" ,
52
- "cygwin" : "windows" ,
53
- }
48
+ dirs = {
49
+ "darwin" : "macos" ,
50
+ "win32" : "windows" ,
51
+ "cygwin" : "windows" ,
52
+ "linux" : "linux" ,
53
+ "freebsd" : "linux" ,
54
+ "openbsd" : "linux"
55
+ }
54
56
55
- directory = dirs .get (platform ) if dirs .get (platform ) else platform
56
- file = "selenium-manager.exe" if directory == "windows" else "selenium-manager"
57
+ directory = dirs .get (sys .platform )
58
+ if directory is None :
59
+ raise WebDriverException (f"Unsupported platform: { sys .platform } " )
57
60
58
- path = Path (__file__ ).parent .joinpath (directory , file )
61
+ if sys .platform in ["freebsd" , "openbsd" ]:
62
+ logger .warning ("Selenium Manager binary may not be compatible with %s; verify settings" , sys .platform )
63
+
64
+ file = "selenium-manager.exe" if directory == "windows" else "selenium-manager"
65
+
66
+ path = Path (__file__ ).parent .joinpath (directory , file )
59
67
60
68
if not path .is_file ():
61
69
raise WebDriverException (f"Unable to obtain working Selenium Manager binary; { path } " )
You can’t perform that action at this time.
0 commit comments