Skip to content

Commit

Permalink
refactor(anci)
Browse files Browse the repository at this point in the history
  • Loading branch information
Taoning Wang committed Apr 25, 2023
1 parent 7b54103 commit ee2c989
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pyradiance/anci.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ def wrapper(*args, **kwargs):
try:
result = func(*args, **kwargs)
except CalledProcessError as e:
err = ""
if e.stderr is not None:
err = e.stderr.decode()
raise RuntimeError(f"An error occurred with exit code {e.returncode}: {err}")
errmsg = e.stderr or b""
raise RuntimeError(f"An error occurred with exit code {e.returncode}: {errmsg.decode()}")
else:
return result
return wrapper

0 comments on commit ee2c989

Please sign in to comment.