Corrects broken format strings in check_i18n.py

In tools/check_i18n.py, the error messages printed out
had format strings that included 5 interpolations, but only
four variables were supplied. This patch simply corrects that
mismatch by including the name of the predicate or checker
that failed.

Closes-Bug: #1263813
Change-Id: I5cacee9ea000f56a9ef45f07367e85f20fa333c7
This commit is contained in:
Jay Pipes 2013-12-23 20:58:31 -05:00
parent 84aeb9a407
commit f778931252

View File

@ -59,7 +59,8 @@ class Visitor(object):
if checker(node): if checker(node):
print('%s:%d %s: %s Error: %s' % print('%s:%d %s: %s Error: %s' %
(self.filename, node.lineno, (self.filename, node.lineno,
self.lines[node.lineno - 1][:-1], msg), self.lines[node.lineno - 1][:-1],
checker.__name__, msg),
file=sys.stderr) file=sys.stderr)
self.error = 1 self.error = 1
return return
@ -81,7 +82,8 @@ class Visitor(object):
elif action == 'error': elif action == 'error':
print('%s:%d %s: %s Error: %s' % print('%s:%d %s: %s Error: %s' %
(self.filename, node.lineno, (self.filename, node.lineno,
self.lines[node.lineno - 1][:-1], msg), self.lines[node.lineno - 1][:-1],
predicate.__name__, msg),
file=sys.stderr) file=sys.stderr)
self.error = 1 self.error = 1
return return