Skip to content
Merged
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
7 changes: 4 additions & 3 deletions py/selenium/webdriver/common/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ def __init__(
driver_path_env_key: Optional[str] = None,
**kwargs,
) -> None:
self.log_output: Optional[Union[int, IOBase]]
if isinstance(log_output, str):
self.log_output = cast(IOBase, open(log_output, "a+", encoding="utf-8"))
elif log_output == subprocess.STDOUT:
self.log_output = cast(Optional[Union[int, IOBase]], None)
self.log_output = None
elif log_output is None or log_output == subprocess.DEVNULL:
self.log_output = cast(Optional[Union[int, IOBase]], subprocess.DEVNULL)
self.log_output = subprocess.DEVNULL
else:
self.log_output = log_output
self.log_output = cast(Union[int, IOBase], log_output)

self.port = port or utils.free_port()
# Default value for every python subprocess: subprocess.Popen(..., creationflags=0)
Expand Down