Skip to content

Commit 2ee529e

Browse files
committed
[py] needs to use hasattr to check for the property
1 parent 32abe16 commit 2ee529e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@ def driver_location(self, options: BaseOptions) -> str:
9393
driver_path = output["driver_path"]
9494
logger.debug(f"Using driver at: {driver_path}")
9595

96-
try:
96+
if hasattr(options.__class__, 'binary_location'):
9797
options.binary_location = browser_path
98-
options.browser_version = None # geckodriver complains if this dev / nightly, etc
99-
except AttributeError:
100-
pass # do not set on options classes that do not support it
98+
options.browser_version = None # if we have the binary location we no longer need the version
10199

102100
return driver_path
103101

0 commit comments

Comments
 (0)