Skip to content

Commit 83cb4d6

Browse files
NoStory-pynavin772
andauthored
[py] Fix type annotation errors in service.py (#16250)
Co-authored-by: Navin Chandra <[email protected]>
1 parent 6421ded commit 83cb4d6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

py/selenium/webdriver/common/service.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ def __init__(
5757
driver_path_env_key: Optional[str] = None,
5858
**kwargs,
5959
) -> None:
60+
self.log_output: Optional[Union[int, IOBase]]
6061
if isinstance(log_output, str):
6162
self.log_output = cast(IOBase, open(log_output, "a+", encoding="utf-8"))
6263
elif log_output == subprocess.STDOUT:
63-
self.log_output = cast(Optional[Union[int, IOBase]], None)
64+
self.log_output = None
6465
elif log_output is None or log_output == subprocess.DEVNULL:
65-
self.log_output = cast(Optional[Union[int, IOBase]], subprocess.DEVNULL)
66+
self.log_output = subprocess.DEVNULL
6667
else:
67-
self.log_output = log_output
68+
self.log_output = cast(Union[int, IOBase], log_output)
6869

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

0 commit comments

Comments
 (0)