Skip to content

Commit a0e569b

Browse files
committed
[py]: Add check=False explicitly to subprocess calls; simplify keys_to_typing
1 parent 4e8e1bc commit a0e569b

2 files changed

Lines changed: 6 additions & 9 deletions

File tree

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def run(args: List[str]) -> dict:
117117
command = " ".join(args)
118118
logger.debug(f"Executing process: {command}")
119119
try:
120-
completed_proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
120+
completed_proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)
121121
stdout = completed_proc.stdout.decode("utf-8").rstrip("\n")
122122
stderr = completed_proc.stderr.decode("utf-8").rstrip("\n")
123123
output = json.loads(stdout)

py/selenium/webdriver/common/utils.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,13 @@ def is_url_connectable(port: Union[int, str]) -> bool:
127127

128128
def keys_to_typing(value: Iterable[AnyKey]) -> List[str]:
129129
"""Processes the values that will be typed in the element."""
130-
_typing: List[str] = []
130+
characters: List[str] = []
131131
for val in value:
132132
if isinstance(val, Keys):
133133
# Todo: Does this even work?
134-
_typing.append(val)
134+
characters.append(val)
135135
elif isinstance(val, (int, float)):
136-
val = str(val)
137-
for i in range(len(val)):
138-
_typing.append(val[i])
136+
characters.extend(str(val))
139137
else:
140-
for i in range(len(val)):
141-
_typing.append(val[i])
142-
return _typing
138+
characters.extend(val)
139+
return characters

0 commit comments

Comments
 (0)