Skip to content

Commit 83c2eb7

Browse files
committed
use conda bin folder, rather than searching PATH
1 parent 1e7ec4f commit 83c2eb7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# under the License.
1717
import json
1818
import logging
19-
import shutil
19+
import os
2020
import subprocess
2121
import sys
2222
from pathlib import Path
@@ -54,9 +54,10 @@ def get_binary() -> Path:
5454

5555
path = Path(__file__).parent.joinpath(directory, file)
5656

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}`")
6061
if not path.is_file():
6162
raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}")
6263

0 commit comments

Comments
 (0)