'INFO', 'LogRecord', 'Logger', 'Manager', 'NOTSET', 'PlaceHolder',
'RootLogger', 'StreamHandler', 'WARN', 'WARNING']
-import sys, os, types, time, string, cStringIO, traceback
+import sys, os, types, time, string, cStringIO, traceback, warnings
try:
import codecs
if _warnings_showwarning is not None:
_warnings_showwarning(message, category, filename, lineno, file, line)
else:
- import warnings
s = warnings.formatwarning(message, category, filename, lineno, line)
logger = getLogger("py.warnings")
if not logger.handlers:
If capture is False, ensure that warnings are not redirected to logging
but to their original destinations.
"""
- import warnings
global _warnings_showwarning
if capture:
if _warnings_showwarning is None:
support unusual filenames (such as those containing semi-colons) in
Content-Disposition headers.
-- Issue #4384: Added integration with warnings module using captureWarnings().
- This change includes a NullHandler which does nothing; it will be of use to
- library developers who want to avoid the "No handlers could be found for
- logger XXX" message which can appear if the library user doesn't configure
- logging.
+- Issue #4384: Added logging integration with warnings module using
+ captureWarnings(). This change includes a NullHandler which does nothing;
+ it will be of use to library developers who want to avoid the "No handlers
+ could be found for logger XXX" message which can appear if the library user
+ doesn't configure logging.
- Issue #3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an
exception.