Skip to content

Commit

Permalink
[py]: Add check=False explicitly to subprocess calls; simplify `keys_…
Browse files Browse the repository at this point in the history
…to_typing`
  • Loading branch information
symonk committed Jul 24, 2023
1 parent 4e8e1bc commit a0e569b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion py/selenium/webdriver/common/selenium_manager.py
Expand Up @@ -117,7 +117,7 @@ def run(args: List[str]) -> dict:
command = " ".join(args)
logger.debug(f"Executing process: {command}")
try:
completed_proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
completed_proc = subprocess.run(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False)
stdout = completed_proc.stdout.decode("utf-8").rstrip("\n")
stderr = completed_proc.stderr.decode("utf-8").rstrip("\n")
output = json.loads(stdout)
Expand Down
13 changes: 5 additions & 8 deletions py/selenium/webdriver/common/utils.py
Expand Up @@ -127,16 +127,13 @@ def is_url_connectable(port: Union[int, str]) -> bool:

def keys_to_typing(value: Iterable[AnyKey]) -> List[str]:
"""Processes the values that will be typed in the element."""
_typing: List[str] = []
characters: List[str] = []
for val in value:
if isinstance(val, Keys):
# Todo: Does this even work?
_typing.append(val)
characters.append(val)
elif isinstance(val, (int, float)):
val = str(val)
for i in range(len(val)):
_typing.append(val[i])
characters.extend(str(val))
else:
for i in range(len(val)):
_typing.append(val[i])
return _typing
characters.extend(val)
return characters

0 comments on commit a0e569b

Please sign in to comment.