Commit f8512d1e authored by LANORE Vincent's avatar LANORE Vincent
Browse files

Corrected bug (hanging popen if stdout is too big) in try_again

parent c47d0740
......@@ -54,6 +54,7 @@ from docopt import docopt
args = docopt(__doc__)
command = args["<command>"]
MESSAGE("Command is " + param(command))
timeout = int(args["--timeout"])
MESSAGE("Timeout is " + param(timeout) + " seconds")
......@@ -69,7 +70,7 @@ class RunCmd():
self.timeout = timeout
def run(self):
self.p = sub.Popen(self.cmd, shell=True, stdout=sub.PIPE)
self.p = sub.Popen(self.cmd.split(" "))
self.p.wait()
def Run(self):
......@@ -87,7 +88,6 @@ class RunCmd():
else:
MESSAGE("Command terminated within timeout.")
okay = True
sys.stdout.write(self.p.stdout.read().decode('ascii'))
MESSAGE("Running command...")
RunCmd(command, timeout).Run()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment