diff --git a/checkm2/diamond.py b/checkm2/diamond.py index e38bd37..4f82570 100644 --- a/checkm2/diamond.py +++ b/checkm2/diamond.py @@ -43,7 +43,7 @@ def check_for_diamond(self): # else returns something non-zero try: - subprocess.call(['diamond', 'help'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT) + subprocess.check_call(['diamond', 'help'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT) except: logging.error("Make sure diamond is on your system path.") sys.exit(1) @@ -98,7 +98,7 @@ def __call_diamond(self, seq_object, diamond_output): diamond_working_dir.name) logging.debug(cmd) - subprocess.call(cmd, shell=True) + subprocess.check_call(cmd, shell=True) logging.debug('Finished Running DIAMOND') except Exception as e: logging.error('An error occured while running DIAMOND: {}'.format(e)) diff --git a/checkm2/prodigal.py b/checkm2/prodigal.py index 97d8c77..a7d8624 100644 --- a/checkm2/prodigal.py +++ b/checkm2/prodigal.py @@ -196,10 +196,8 @@ def areORFsCalled(self, bNucORFs): def checkForProdigal(self): """Check to see if Prodigal is on the system before we try to run it.""" - # Assume that a successful prodigal -h returns 0 and anything - # else returns something non-zero try: - subprocess.call(['prodigal', '-h'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT) + subprocess.check_call(['prodigal', '-h'], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT) except: logging.error("Make sure prodigal is on your system path.") sys.exit(1)