File tree Expand file tree Collapse file tree 1 file changed +18
-20
lines changed
Expand file tree Collapse file tree 1 file changed +18
-20
lines changed Original file line number Diff line number Diff line change @@ -14,23 +14,21 @@ def __init__(
1414 @staticmethod
1515 def _get_default_binary_location ():
1616 os_name = platform .system ()
17- match os_name :
18- case 'Windows' :
19- browser_path = (
20- r'C:\Program Files\Google\Chrome\Application\chrome.exe'
21- )
22- return BrowserOptionsManager .validate_browser_path (
23- browser_path
24- )
25- case 'Linux' :
26- browser_path = '/usr/bin/google-chrome'
27- return BrowserOptionsManager .validate_browser_path (
28- browser_path
29- )
30- case 'Darwin' :
31- browser_path = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
32- return BrowserOptionsManager .validate_browser_path (
33- browser_path
34- )
35- case _:
36- raise ValueError ('Unsupported OS' )
17+ browser_paths = {
18+ 'Windows' :
19+ r'C:\Program Files\Google\Chrome\Application\chrome.exe' ,
20+ 'Linux' :
21+ '/usr/bin/google-chrome' ,
22+ 'Darwin' :
23+ '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
24+ }
25+
26+ browser_path = browser_paths .get (os_name )
27+
28+ if not browser_path :
29+ raise ValueError ('Unsupported OS' )
30+
31+ return BrowserOptionsManager .validate_browser_path (
32+ browser_path
33+ )
34+
You can’t perform that action at this time.
0 commit comments