From: Simon Glass Date: Thu, 27 Sep 2012 15:33:46 +0000 (+0000) Subject: patman: Handle checkpatch.pl not providing file/line info X-Git-Tag: v2013.01-rc1~248 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=afb9bf55d093287458f4c2d3d2e42d90a7e91c95;p=oweals%2Fu-boot.git patman: Handle checkpatch.pl not providing file/line info Sometimes we don't get a valid filename or line number from checkpatch.pl, for example if the patch is in a bad format. Deal with this by using a default value, rather than a stack trace. Signed-off-by: Simon Glass --- diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py index a234277177..d831087d88 100644 --- a/tools/patman/checkpatch.py +++ b/tools/patman/checkpatch.py @@ -145,8 +145,9 @@ def CheckPatches(verbose, args): if len(problems) != error_count + warning_count: print "Internal error: some problems lost" for item in problems: - print GetWarningMsg(col, item['type'], item['file'], - item['line'], item['msg']) + print GetWarningMsg(col, item['type'], + item.get('file', ''), + item.get('line', 0), item['msg']) #print stdout if error_count != 0 or warning_count != 0: str = 'checkpatch.pl found %d error(s), %d warning(s)' % (