mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1044165 - fix BuildReaderError exception printing to cope properly with SyntaxError; r=gps
Some moz.build syntax errors cause the thrown SyntaxError object to not include an offset field, leading to all sorts of hilarity when we try printing messages depending on SyntaxError.offset. Check for this case and simply don't print the caret if so.
This commit is contained in:
parent
80686692d8
commit
5f9ab2e8fa
@ -566,7 +566,8 @@ class BuildReaderError(Exception):
|
||||
s.write('on line %d:\n' % inner.lineno)
|
||||
s.write('\n')
|
||||
s.write(' %s\n' % inner.text)
|
||||
s.write((' ' * (inner.offset + 4)) + '^\n')
|
||||
if inner.offset:
|
||||
s.write((' ' * (inner.offset + 4)) + '^\n')
|
||||
s.write('\n')
|
||||
s.write('Fix the syntax error and try again.\n')
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user