Warning Framework
Warning filter examples
# Ignore all deprecation warnings
warnings.filterwarnings('ignore','.*',DeprecationWarning)
warnings.filterwarnings('ignore', category=DeprecationWarning)
# Ignore deprecation warnings created by this module
warnings.filterwarnings('ignore',DeprecationWarning,module=__name__)
# Turn SyntaxWarnings into exceptions
warnings.filterwarnings('error',SyntaxWarning)
-Waction:message:category:module:lineno option
python -Wignore::DeprecationWarning
python -Wignore::DeprecationWarning:foobar
python -Werror::SyntaxWarning
python -Wignore # Ignore all warnings
python -Werror # Turn all warnings into errors
|