From 1db6202f29641596b170888272572fec45f13576 Mon Sep 17 00:00:00 2001 From: Valentin David Date: Sat, 25 Nov 2017 15:53:32 +0100 Subject: Allow stdout and stderr to be overriden in Plugin.call --- buildstream/plugin.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'buildstream') diff --git a/buildstream/plugin.py b/buildstream/plugin.py index a793c5e5b..35b116dfe 100644 --- a/buildstream/plugin.py +++ b/buildstream/plugin.py @@ -624,12 +624,11 @@ class Plugin(): # def __call(self, *popenargs, collect_stdout=False, fail=None, **kwargs): - if 'stdout' in kwargs or 'stderr' in kwargs: - raise ValueError('May not override destination output') - with self._output_file() as output_file: - kwargs['stdout'] = output_file - kwargs['stderr'] = output_file + if 'stdout' not in kwargs: + kwargs['stdout'] = output_file + if 'stderr' not in kwargs: + kwargs['stderr'] = output_file if collect_stdout: kwargs['stdout'] = subprocess.PIPE -- cgit v1.2.1