Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py: Ensure DRIVER_PATH_ENV_KEY defaults to string #14862

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion py/selenium/webdriver/common/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Service(ABC):
:param port: Port for the service to run on, defaults to 0 where the operating system will decide.
:param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file.
:param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`.
:param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
"""

def __init__(
Expand Down Expand Up @@ -245,4 +246,6 @@ def _start_process(self, path: str) -> None:
raise

def env_path(self) -> Optional[str]:
return os.getenv(self.DRIVER_PATH_ENV_KEY, None)
if self.DRIVER_PATH_ENV_KEY:
return os.getenv(self.DRIVER_PATH_ENV_KEY, None)
return None