Merge branch 'bug/279' into 'master'

Avoid calling rstrip on None

Closes #279

See merge request !173
This commit is contained in:
Ian Cordasco 2017-01-27 21:29:36 +00:00
commit 77d887f400

View file

@ -443,9 +443,14 @@ class FileChecker(object):
# numbers. We need to decrement the column number by 1 at # numbers. We need to decrement the column number by 1 at
# least. # least.
column_offset = 1 column_offset = 1
row_offset = 0
# See also: https://gitlab.com/pycqa/flake8/issues/237 # See also: https://gitlab.com/pycqa/flake8/issues/237
physical_line = token[-1] physical_line = token[-1]
# NOTE(sigmavirus24): Not all "tokens" have a string as the last
# argument. In this event, let's skip trying to find the correct
# column and row values.
if physical_line is not None:
# NOTE(sigmavirus24): SyntaxErrors also don't exactly have a # NOTE(sigmavirus24): SyntaxErrors also don't exactly have a
# "physical" line so much as what was accumulated by the point # "physical" line so much as what was accumulated by the point
# tokenizing failed. # tokenizing failed.