diff options
author | BonfaceKilz | 2021-06-25 17:05:22 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-06-25 17:05:22 +0300 |
commit | 5faac7a399e766c4677e59295044966723237e0c (patch) | |
tree | 1f7431699e2822d320daa026a70ba16d9865e52c | |
parent | a45f1fd15a5adfab1f284af15349175b7f765296 (diff) | |
download | genenetwork3-5faac7a399e766c4677e59295044966723237e0c.tar.gz |
Check for the correct result code
When programs terminate with an error, they usually return a -1!
-rw-r--r-- | gn3/commands.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index 14bd295..459ccee 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -78,6 +78,6 @@ def run_cmd(cmd: str) -> Dict: """Run CMD and return the CMD's status code and output as a dict""" results = subprocess.run(cmd, capture_output=True, shell=True, check=False) out = str(results.stdout, 'utf-8') - if results.returncode > 0: # Error! + if results.returncode < 0: # Error! out = str(results.stderr, 'utf-8') return {"code": results.returncode, "output": out} |