From e049f364a1b5f483ba1d6d1f3dc4459eefb3e03a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Sat, 17 Jun 2006 11:44:55 +0000 Subject: [PATCH] * suppress warnings when debug is not given --- pisi/util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pisi/util.py b/pisi/util.py index c2045186..8bc638bf 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -159,7 +159,7 @@ class TeeOutFile: # TODO: it might be worthwhile to try to remove the # use of ctx.stdout, and use run_batch()'s return -# values instead. +# values instead. but this is good enough :) def run_logged(cmd): """run command and get return value""" ctx.ui.info(_('Running ') + cmd, verbose=True) @@ -173,7 +173,10 @@ def run_logged(cmd): if ctx.stderr: stderr = ctx.stderr else: - stderr = None + if ctx.get_option('debug'): + stderr = None + else: + stderr = subprocess.STDOUT p = subprocess.Popen(cmd, shell=True, stdout=stdout, stderr=stderr) out, err = p.communicate()