Skip to content

Commit

Permalink
MAINT: call str.strip before truth-checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Bas van Beek committed Jun 9, 2022
1 parent fa4674e commit 025d9b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nanoCAT/recipes/fast_sigma.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ def _run(command: str, smiles: str, err_msg: str) -> None | subprocess.Completed
status = None
try:
status = subprocess.run(command, shell=True, check=True, text=True, capture_output=True)
stderr = status.stderr
stdout = status.stdout
stderr = status.stderr.strip()
stdout = status.stdout.strip()
if stderr:
raise RuntimeError(stderr.strip())
raise RuntimeError(stderr)
elif "WARNING" in stdout:
raise RuntimeError(stdout.strip())
raise RuntimeError(stdout)
except (RuntimeError, subprocess.SubprocessError) as ex:
warn = RuntimeWarning(err_msg.format(smiles))
warn.__cause__ = ex
Expand Down

0 comments on commit 025d9b2

Please sign in to comment.