Commit cab4c2b2 authored by Kevin Atkinson's avatar Kevin Atkinson

Bug fix to last commit.

parent d01ec626
......@@ -5350,12 +5350,16 @@ def escapeshellarg(s):
# Run a command. args is a list of strings to pass as arguments to cmd.
# Return the exitcode and the output as a tuple.
#
def runcommand(cmd, separate_stderr=False):
def runcommand(cmd, separate_stderr=None):
from subprocess import *
if separate_stderr:
if separate_stderr == True:
p = Popen(cmd, stdin=None, stdout=PIPE, stderr=PIPE, shell=True)
(stdoutdata, stderrdata) = p.communicate()
return (p.returncode << 8, stdoutdata, stderrdata)
elif separate_stderr == False:
p = Popen(cmd, stdin=None, stdout=PIPE, stderr=STDOUT, shell=True)
(stdoutdata, stderrdata) = p.communicate()
return (p.returncode << 8, stdoutdata, stderrdata)
else:
p = Popen(cmd, stdin=None, stdout=PIPE, stderr=STDOUT, shell=True)
(stdoutdata, stderrdata) = p.communicate()
......
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