(e, filename, macro_linenr=None)
| 6756 | |
| 6757 | |
| 6758 | def _decoding_error(e, filename, macro_linenr=None): |
| 6759 | # Gives the filename and context for UnicodeDecodeError's, which are a pain |
| 6760 | # to debug otherwise. 'e' is the UnicodeDecodeError object. |
| 6761 | # |
| 6762 | # If the decoding error is for the output of a $(shell,...) command, |
| 6763 | # macro_linenr holds the line number where it was run (the exact line |
| 6764 | # number isn't available for decoding errors in files). |
| 6765 | |
| 6766 | raise KconfigError( |
| 6767 | "\n" |
| 6768 | "Malformed {} in {}\n" |
| 6769 | "Context: {}\n" |
| 6770 | "Problematic data: {}\n" |
| 6771 | "Reason: {}".format( |
| 6772 | e.encoding, |
| 6773 | "'{}'".format(filename) if macro_linenr is None else |
| 6774 | "output from macro at {}:{}".format(filename, macro_linenr), |
| 6775 | e.object[max(e.start - 40, 0):e.end + 40], |
| 6776 | e.object[e.start:e.end], |
| 6777 | e.reason)) |
| 6778 | |
| 6779 | |
| 6780 | def _warn_verbose_deprecated(fn_name): |
no test coverage detected