File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
py/selenium/webdriver/common Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 16
16
# under the License.
17
17
import json
18
18
import logging
19
- import shutil
19
+ import os
20
20
import subprocess
21
21
import sys
22
22
from pathlib import Path
@@ -54,9 +54,10 @@ def get_binary() -> Path:
54
54
55
55
path = Path (__file__ ).parent .joinpath (directory , file )
56
56
57
- if not path .is_file ():
58
- # conda has a separate package selenium-manager, installs in bin folder
59
- path = Path (shutil .which (file ))
57
+ if not path .is_file () and os .environ ['CONDA_PREFIX' ]:
58
+ # conda has a separate package selenium-manager, installs in bin
59
+ path = Path (os .path .join (os .environ ['CONDA_PREFIX' ], 'bin' , file ))
60
+ logger .debug (f"Conda environment detected, using `{ path } `" )
60
61
if not path .is_file ():
61
62
raise WebDriverException (f"Unable to obtain working Selenium Manager binary; { path } " )
62
63
You can’t perform that action at this time.
0 commit comments