Did I find the right examples for you? yes no

All Samples(9)  |  Call(0)  |  Derive(0)  |  Import(9)
_warnings provides basic warning filtering support.
It is a helper module to speed up interpreter start-up.

src/t/r/TrustRouter-HEAD/client/packaging/Windows/Python32/Lib/importlib/__init__.py   TrustRouter(Download)
_bootstrap.errno = errno
_bootstrap._io = _io
import _warnings
_bootstrap._warnings = _warnings
 

src/i/m/importlib_full-0.0.1/importlib_full/__init__.py   importlib_full(Download)
_bootstrap.errno = errno
_bootstrap._io = _io
import _warnings
_bootstrap._warnings = _warnings
 

src/s/y/Sypy-HEAD/module/_warnings/test/test_warnings.py   Sypy(Download)
    def test_defaults(self):
        import _warnings
        assert _warnings.once_registry == {}
        assert _warnings.default_action == 'default'
        assert "PendingDeprecationWarning" in str(_warnings.filters)
 
    def test_warn(self):
        import _warnings
    def test_lineno(self):
        import warnings, _warnings, sys
        with warnings.catch_warnings(record=True) as w:
            _warnings.warn("some message", Warning)
            lineno = sys._getframe().f_lineno - 1 # the line above
            assert w[-1].lineno == lineno
 
    def test_warn_explicit(self):
        import _warnings
    def test_default_action(self):
        import warnings, _warnings
        warnings.defaultaction = 'ignore'
        warnings.resetwarnings()
        with warnings.catch_warnings(record=True) as w:

src/m/a/main-HEAD/Languages/IronPython/Tests/modules/misc/_warnings_test.py   main(Download)
skiptest("silverlight")
 
import _warnings
from iptest.assert_util import stderr_trapper as output_trapper
 

src/i/r/ironpython3-HEAD/Tests/modules/misc/_warnings_test.py   ironpython3(Download)
skiptest("silverlight")
 
import _warnings
from iptest.assert_util import stderr_trapper as output_trapper