warnings.warn_explicit()

warnings.warn_explicit(message, category, filename, lineno, module=None, registry=None, module_globals=None)

This is a low-level interface to the functionality of warn(), passing in explicitly the message, category, filename and line number, and optionally the module name and the registry (which should be the __warningregistry__ dictionary of the module). The module name defaults to the filename with .py stripped; if no registry is passed, the warning is never suppressed. message must be a string and category a subclass of Warning or message may be a Warning instance, in which case category will be ignored.

module_globals, if supplied, should be the global namespace in use by the code for which the warning is issued. (This argument is used to support displaying source for modules found in zipfiles or other non-filesystem import sources).

doc_python
2016-10-07 17:47:12
Comments
Leave a Comment

Please login to continue.