Skip to content

Commit

Permalink
Dev: Tools: crm: make get_stdin show stderr output
Browse files Browse the repository at this point in the history
Mercurial revision: cb622d4a2120fa65f1434acb55495859af32ba6d
  • Loading branch information
dmuhamedagic committed Aug 26, 2009
1 parent 33ffdd0 commit 18a32f3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/crm.in
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,12 @@ def get_stdin(cmd, stderr_on = True):
Run a cmd, return stdin output.
stderr_on controls whether to show output which comes on stderr.
'''
proc = subprocess.Popen(cmd, shell=True, \
stdout=subprocess.PIPE, \
stderr=stderr_on and None or subprocess.PIPE)
if stderr_on:
stderr = None
else:
stderr = subprocess.PIPE
proc = subprocess.Popen(cmd, shell = True, \
stdout = subprocess.PIPE, stderr = stderr)
outp = proc.communicate()[0]
proc.wait()
outp = outp.strip()
Expand Down

0 comments on commit 18a32f3

Please sign in to comment.