diff --git a/runbot/runbot.py b/runbot/runbot.py index 7516022b..77dcd4e9 100644 --- a/runbot/runbot.py +++ b/runbot/runbot.py @@ -548,7 +548,7 @@ class runbot_build(osv.osv): return cmd, mods - def spawn(self, cmd, lock_path, log_path, cpu_limit=None, shell=False): + def spawn(self, cmd, lock_path, log_path, cpu_limit=None, shell=False, hidestderr=False): def preexec_fn(): os.setsid() if cpu_limit: @@ -562,7 +562,11 @@ class runbot_build(osv.osv): lock(lock_path) out=open(log_path,"w") _logger.debug("spawn: %s stdout: %s", ' '.join(cmd), log_path) - p=subprocess.Popen(cmd, stdout=out, stderr=out, preexec_fn=preexec_fn, shell=shell) + if hidestderr: + stderr = out + else: + stderr = open(os.devnull, 'w') + p=subprocess.Popen(cmd, stdout=out, stderr=stderr, preexec_fn=preexec_fn, shell=shell) return p.pid def github_status(self, cr, uid, ids, context=None):