From c8d07c95d6051dcbe5d8cc4d930b66b6efac1324 Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Fri, 16 Mar 2012 14:18:06 +0800 Subject: [PATCH] correct stderr output lost in runner.runtool Signed-off-by: Gui Chen --- mic/utils/runner.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mic/utils/runner.py b/mic/utils/runner.py index 12fa930..9e0522a 100644 --- a/mic/utils/runner.py +++ b/mic/utils/runner.py @@ -63,9 +63,9 @@ def runtool(cmdln_or_args, catch=1): try: p = Popen(cmdln_or_args, stdout=sout, stderr=serr, shell=shell) - out = p.communicate()[0] - if out is None: - out = '' + (sout, serr) = p.communicate() + # combine stdout and stderr, filter None out + out = ''.join(filter(None, [sout, serr])) except OSError, e: if e.errno == 2: # [Errno 2] No such file or directory -- 2.7.4