Merge branch 'bug/214' into 'master'

Avoid TypeErrors when handling a SyntaxError



See merge request !121
This commit is contained in:
Ian Cordasco 2016-08-28 00:58:19 +00:00
commit c17043ff3f
2 changed files with 17 additions and 1 deletions

View file

@ -253,7 +253,10 @@ class StyleGuide(object):
int
"""
# NOTE(sigmavirus24): Apparently we're provided with 0-indexed column
# numbers so we have to offset that here.
# numbers so we have to offset that here. Also, if a SyntaxError is
# caught, column_number may be None.
if not column_number:
column_number = 0
error = Error(code, filename, line_number, column_number + 1, text,
physical_line)
error_is_selected = (self.should_report_error(error.code) is