@@ -1566,10 +1566,10 @@ def get_local_driver(
1566
1566
options = firefox_options ,
1567
1567
)
1568
1568
else :
1569
- raise Exception ( e . msg ) # Not an obvious fix.
1569
+ raise # Not an obvious fix.
1570
1570
else :
1571
1571
return webdriver .Firefox (
1572
- service_log_path = os .path . devnull ,
1572
+ service_log_path = os .devnull ,
1573
1573
options = firefox_options ,
1574
1574
)
1575
1575
elif browser_name == constants .Browser .INTERNET_EXPLORER :
@@ -1836,7 +1836,7 @@ def get_local_driver(
1836
1836
if selenium4 :
1837
1837
try :
1838
1838
service = EdgeService (
1839
- executable_path = LOCAL_EDGEDRIVER , log_path = os .path . devnull
1839
+ executable_path = LOCAL_EDGEDRIVER , log_path = os .devnull
1840
1840
)
1841
1841
driver = Edge (service = service , options = edge_options )
1842
1842
except Exception as e :
@@ -1856,13 +1856,13 @@ def get_local_driver(
1856
1856
elif "DevToolsActivePort file doesn't exist" in e .msg :
1857
1857
service = EdgeService (
1858
1858
executable_path = LOCAL_EDGEDRIVER ,
1859
- log_path = os .path . devnull ,
1859
+ log_path = os .devnull ,
1860
1860
)
1861
1861
# https://stackoverflow.com/a/56638103/7058266
1862
1862
edge_options .add_argument ("--remote-debugging-port=9222" )
1863
1863
return Edge (service = service , options = edge_options )
1864
1864
if not auto_upgrade_edgedriver :
1865
- raise Exception ( e . msg ) # Not an obvious fix. Raise .
1865
+ raise # Not an obvious fix.
1866
1866
else :
1867
1867
pass # Try upgrading EdgeDriver to match Edge.
1868
1868
args = " " .join (sys .argv )
@@ -1881,7 +1881,7 @@ def get_local_driver(
1881
1881
_repair_edgedriver (edge_version )
1882
1882
_mark_driver_repaired ()
1883
1883
service = EdgeService (
1884
- executable_path = LOCAL_EDGEDRIVER , log_path = os .path . devnull
1884
+ executable_path = LOCAL_EDGEDRIVER , log_path = os .devnull
1885
1885
)
1886
1886
driver = Edge (service = service , options = edge_options )
1887
1887
return driver
@@ -1891,7 +1891,7 @@ def get_local_driver(
1891
1891
try :
1892
1892
driver = Edge (
1893
1893
executable_path = LOCAL_EDGEDRIVER ,
1894
- service_log_path = os .path . devnull ,
1894
+ service_log_path = os .devnull ,
1895
1895
capabilities = capabilities ,
1896
1896
)
1897
1897
except Exception as e :
@@ -1911,13 +1911,13 @@ def get_local_driver(
1911
1911
elif "DevToolsActivePort file doesn't exist" in e .msg :
1912
1912
service = EdgeService (
1913
1913
executable_path = LOCAL_EDGEDRIVER ,
1914
- log_path = os .path . devnull ,
1914
+ log_path = os .devnull ,
1915
1915
)
1916
1916
# https://stackoverflow.com/a/56638103/7058266
1917
1917
edge_options .add_argument ("--remote-debugging-port=9222" )
1918
1918
return Edge (service = service , options = edge_options )
1919
1919
if not auto_upgrade_edgedriver :
1920
- raise Exception ( e . msg ) # Not an obvious fix. Raise .
1920
+ raise # Not an obvious fix.
1921
1921
else :
1922
1922
pass # Try upgrading EdgeDriver to match Edge.
1923
1923
args = " " .join (sys .argv )
@@ -1937,7 +1937,7 @@ def get_local_driver(
1937
1937
_mark_driver_repaired ()
1938
1938
driver = Edge (
1939
1939
executable_path = LOCAL_EDGEDRIVER ,
1940
- service_log_path = os .path . devnull ,
1940
+ service_log_path = os .devnull ,
1941
1941
capabilities = capabilities ,
1942
1942
)
1943
1943
return driver
@@ -2092,7 +2092,7 @@ def get_local_driver(
2092
2092
if selenium4 :
2093
2093
service = ChromeService (
2094
2094
executable_path = LOCAL_CHROMEDRIVER ,
2095
- log_path = os .path . devnull ,
2095
+ log_path = os .devnull ,
2096
2096
)
2097
2097
driver = webdriver .Chrome (
2098
2098
service = service ,
@@ -2101,19 +2101,19 @@ def get_local_driver(
2101
2101
else :
2102
2102
driver = webdriver .Chrome (
2103
2103
executable_path = LOCAL_CHROMEDRIVER ,
2104
- service_log_path = os .path . devnull ,
2104
+ service_log_path = os .devnull ,
2105
2105
options = chrome_options ,
2106
2106
)
2107
2107
else :
2108
2108
if selenium4 :
2109
- service = ChromeService (log_path = os .path . devnull )
2109
+ service = ChromeService (log_path = os .devnull )
2110
2110
driver = webdriver .Chrome (
2111
2111
service = service , options = chrome_options
2112
2112
)
2113
2113
else :
2114
2114
driver = webdriver .Chrome (
2115
2115
options = chrome_options ,
2116
- service_log_path = os .path . devnull ,
2116
+ service_log_path = os .devnull ,
2117
2117
)
2118
2118
except Exception as e :
2119
2119
auto_upgrade_chromedriver = False
@@ -2122,7 +2122,7 @@ def get_local_driver(
2122
2122
elif "Chrome version must be between" in e .msg :
2123
2123
auto_upgrade_chromedriver = True
2124
2124
if not auto_upgrade_chromedriver :
2125
- raise Exception ( e . msg ) # Not an obvious fix. Raise .
2125
+ raise # Not an obvious fix.
2126
2126
else :
2127
2127
pass # Try upgrading ChromeDriver to match Chrome.
2128
2128
mcv = None # Major Chrome Version
@@ -2267,14 +2267,14 @@ def get_local_driver(
2267
2267
)
2268
2268
chrome_options .headless = False
2269
2269
return webdriver .Chrome (options = chrome_options )
2270
- except Exception as e :
2270
+ except Exception :
2271
2271
try :
2272
2272
# Try again if Chrome didn't launch
2273
2273
return webdriver .Chrome (options = chrome_options )
2274
2274
except Exception :
2275
2275
pass
2276
2276
if headless :
2277
- raise Exception ( e )
2277
+ raise
2278
2278
if LOCAL_CHROMEDRIVER and os .path .exists (LOCAL_CHROMEDRIVER ):
2279
2279
try :
2280
2280
make_driver_executable_if_not (LOCAL_CHROMEDRIVER )
0 commit comments