Skip to content

Commit

Permalink
Merge df054db into 3041af3
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile authored Nov 16, 2023
2 parents 3041af3 + df054db commit 32b0a60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions py/selenium/webdriver/common/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ def __init__(
) -> None:
if isinstance(log_output, str):
self.log_output = open(log_output, "a+", encoding="utf-8")
elif log_output is subprocess.STDOUT:
elif log_output == subprocess.STDOUT:
self.log_output = None
elif log_output is None or log_output is subprocess.DEVNULL:
self.log_output = open(os.devnull, "wb")
elif log_output is None or log_output == subprocess.DEVNULL:
self.log_output = subprocess.DEVNULL
else:
self.log_output = log_output

Expand Down Expand Up @@ -135,7 +135,7 @@ def send_remote_shutdown_command(self) -> None:
def stop(self) -> None:
"""Stops the service."""

if self.log_output != PIPE:
if self.log_output not in {PIPE, subprocess.DEVNULL}:
if isinstance(self.log_output, IOBase):
self.log_output.close()
elif isinstance(self.log_output, int):
Expand Down

0 comments on commit 32b0a60

Please sign in to comment.