Fixed: if linted text didn't end with a newline the last character would be ignored.

This commit is contained in:
Alexander Ljungberg
2012-05-24 19:26:05 +01:00
parent 24cce3ca8a
commit 0d5b4d4958
+4 -1
View File
@@ -357,7 +357,10 @@ class LintChecker(object):
def next_statement(self, expect_line=False, check_line=True):
try:
while True:
raw_line = self.sourcefile.next()[:-1] # strip EOL
raw_line = self.sourcefile.next()
# strip EOL
if raw_line[-1] == '\n': # ... unless this is the last line which might not have a \n.
raw_line = raw_line[:-1]
try:
self.line = unicode(raw_line, 'utf-8', 'strict') # convert to Unicode