[Python-Dev] [Python-checkins] cpython: removed spurious output

Nick Coghlan ncoghlan at gmail.com
Tue May 31 07:18:28 CEST 2011


On Mon, May 30, 2011 at 8:25 PM, tarek.ziade <python-checkins at python.org> wrote:
> +        old_out = sys.stdout
> +        sys.stderr = StringIO()
> +        try:
> +            dist = self.run_setup('install_dist', '--prefix=' + self.root_dir)
> +        finally:
> +            sys.sterr = old_out

There's actually a helper for this in test.support:

  with support.captured_stderr():
    dist = self.run_setup('install_dist', '--prefix=' + self.root_dir)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list