comparison tools/effectiveT3/effectiveT3.py @ 31:3ef6c246ccac draft

planemo upload for repository https://github.com/peterjc/pico_galaxy/tree/master/tools/effectiveT3 commit 79bbb921cb5aa953f0323accd6c8c293c6e486cf-dirty
author peterjc
date Tue, 06 Jun 2017 10:19:10 -0400
parents 007e86eff414
children 1129cafdf0ae
comparison
equal deleted inserted replaced
30:007e86eff414 31:3ef6c246ccac
71 def run(cmd): 71 def run(cmd):
72 """Run the command line string via subprocess.""" 72 """Run the command line string via subprocess."""
73 # Avoid using shell=True when we call subprocess to ensure if the Python 73 # Avoid using shell=True when we call subprocess to ensure if the Python
74 # script is killed, so too is the child process. 74 # script is killed, so too is the child process.
75 try: 75 try:
76 child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 76 child = subprocess.Popen(cmd, universal_newlines=True,
77 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
77 except Exception as err: 78 except Exception as err:
78 sys.exit("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err)) 79 sys.exit("Error invoking command:\n%s\n\n%s\n" % (" ".join(cmd), err))
79 # Use .communicate as can get deadlocks with .wait(), 80 # Use .communicate as can get deadlocks with .wait(),
80 stdout, stderr = child.communicate() 81 stdout, stderr = child.communicate()
81 return_code = child.returncode 82 return_code = child.returncode