scripts/verify_log_statements.py: on parse error, print file

If string eval encounters an uncovered parse error, it's useful to know which
file it happened in.

Change-Id: I5fe9a3bbdbfb8a995f24596bf09e70ca5bb3fe8a
This commit is contained in:
Neels Hofmeyr 2018-07-19 19:48:26 +02:00
parent 6475204b4c
commit e83f8a4737
1 changed files with 45 additions and 42 deletions

View File

@ -63,6 +63,7 @@ def check_file(f):
if not (f.endswith('.h') or f.endswith('.c') or f.endswith('.cpp')):
return []
try:
errors_found = []
file_content = codecs.open(f, "r", "utf-8").read()
@ -115,7 +116,9 @@ def check_file(f):
r.line = line
return errors_found
except:
print("ERROR WHILE PROCESSING %r" % f, file=sys.stderr)
raise
all_errors_found = []
for f in args: