A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-March/077815.html below:

[Python-Dev] [Python-3000-checkins] r61522 - python/branches/py3k/Lib/test/test_print.py

[Python-Dev] [Python-3000-checkins] r61522 - python/branches/py3k/Lib/test/test_print.py [Python-Dev] [Python-3000-checkins] r61522 - python/branches/py3k/Lib/test/test_print.pyNick Coghlan ncoghlan at gmail.com
Wed Mar 19 12:55:08 CET 2008
eric.smith wrote:
> + at contextmanager
> +def stdout_redirected(new_stdout):
> +    save_stdout = sys.stdout
> +    sys.stdout = new_stdout
> +    try:
> +        yield None
> +    finally:
> +        sys.stdout = save_stdout

I think this test could easily be tweaked to use 
test.test_support.captured_stdout rather than reinventing the wheel :)

(cc'ing python-dev for visibility since the sprints are generating a lot 
of python-checkins traffic)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4