MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _formatwarnmsg

Function _formatwarnmsg

tools/python-3.11.9-amd64/Lib/warnings.py:118–129  ·  view source on GitHub ↗

Function to format a warning the standard way.

(msg)

Source from the content-addressed store, hash-verified

116_formatwarning_orig = formatwarning
117
118def _formatwarnmsg(msg):
119 """Function to format a warning the standard way."""
120 try:
121 fw = formatwarning
122 except NameError:
123 pass
124 else:
125 if fw is not _formatwarning_orig:
126 # warnings.formatwarning() was replaced
127 return fw(msg.message, msg.category,
128 msg.filename, msg.lineno, msg.line)
129 return _formatwarnmsg_impl(msg)
130
131def filterwarnings(action, message="", category=Warning, module="", lineno=0,
132 append=False):

Callers 1

_showwarnmsg_implFunction · 0.85

Calls 1

_formatwarnmsg_implFunction · 0.85

Tested by

no test coverage detected