Function to format a warning the standard way.
(msg)
| 116 | _formatwarning_orig = formatwarning |
| 117 | |
| 118 | def _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 | |
| 131 | def filterwarnings(action, message="", category=Warning, module="", lineno=0, |
| 132 | append=False): |
no test coverage detected