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-August/081849.html below:

[Python-Dev] Why does httplib import from test_support?

[Python-Dev] Why does httplib import from test_support? [Python-Dev] Why does httplib import from test_support?Nick Coghlan ncoghlan at gmail.com
Mon Aug 18 13:35:25 CEST 2008
skip at pobox.com wrote:
> The import statement seems to work from an interactive shell (I have a
> module named test in the same directory as the main prog, hence the
> problem), but even if it does work should we be importing stuff from the
> test package in non-test code?

I saw those checkins go by on the checkins list - they have to do with
silencing -3 warnings for modules that the stdlib still uses in Python
2.6 for backwards compatibility reasons (but switching to the relevant
new approaches in 3.0, thus making the warnings a false alarm).

test.test_support.catch_warning is a convenient way to suppress a
warning for a small piece of code and then revert the state of the
warnings module back to the way it was afterwards.

Those imports should probably be guarded with sys.py3kwarn though, with
a standard import being used if the command line flag isn't set.

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