Handle return code correctly

This commit is contained in:
Radon Rosborough 2020-06-11 14:44:24 -06:00
parent 66fea5be40
commit db89ef25d9
1 changed files with 1 additions and 3 deletions

View File

@ -10,9 +10,7 @@ import sys
import tempfile
import time
result = subprocess.run(
["pgrep", "-x", "riju-install"], check=True, stdout=subprocess.PIPE
)
result = subprocess.run(["pgrep", "-x", "riju-install"], stdout=subprocess.PIPE)
assert result.returncode in {0, 1}
for pid in result.stdout.decode().splitlines():
print(f"Found existing process {pid}, trying to kill ...", file=sys.stderr)