(e, filename, macro_linenr=None)
| 6832 | |
| 6833 | |
| 6834 | def _decoding_error(e, filename, macro_linenr=None): |
| 6835 | # Gives the filename and context for UnicodeDecodeError's, which are a pain |
| 6836 | # to debug otherwise. 'e' is the UnicodeDecodeError object. |
| 6837 | # |
| 6838 | # If the decoding error is for the output of a $(shell,...) command, |
| 6839 | # macro_linenr holds the line number where it was run (the exact line |
| 6840 | # number isn't available for decoding errors in files). |
| 6841 | |
| 6842 | raise KconfigError( |
| 6843 | "\n" |
| 6844 | "Malformed {} in {}\n" |
| 6845 | "Context: {}\n" |
| 6846 | "Problematic data: {}\n" |
| 6847 | "Reason: {}".format( |
| 6848 | e.encoding, |
| 6849 | "'{}'".format(filename) if macro_linenr is None else |
| 6850 | "output from macro at {}:{}".format(filename, macro_linenr), |
| 6851 | e.object[max(e.start - 40, 0):e.end + 40], |
| 6852 | e.object[e.start:e.end], |
| 6853 | e.reason)) |
| 6854 | |
| 6855 | |
| 6856 | def _warn_verbose_deprecated(fn_name): |
no test coverage detected