Skip to content

Commit

Permalink
Fix for windows path conversion with given as arg to run_cli_cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
coreyeng committed Jul 3, 2023
1 parent c4d6287 commit 69242fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/origen/origen/helpers/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def run_cli_cmd(cmd, *,
else:
def to_cmd(c):
if isinstance(c, pathlib.Path):
return str(c)
return c.as_posix()
else:
return c
cmd = list(map(to_cmd, cmd))
Expand Down Expand Up @@ -68,7 +68,9 @@ def to_cmd(c):
cmd = ' '.join(cmd)
raise RuntimeError(f"Expected cmd '{cmd}' to fail but received return code 0")
else:
result = subprocess.run(cmd, shell=shell, check=check, capture_output=True, text=True, input=input, env=subp_env)
result = subprocess.run(cmd, shell=shell, check=False, capture_output=True, text=True, input=input, env=subp_env)
print(result.stderr)
print(result.stdout)
if return_details:
return {
"stderr": result.stderr,
Expand Down

0 comments on commit 69242fa

Please sign in to comment.