summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTORS.txt2
-rw-r--r--ChangeLog2
-rw-r--r--pylint/checkers/format.py7
3 files changed, 9 insertions, 2 deletions
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
index d714c90be..856f112a4 100644
--- a/CONTRIBUTORS.txt
+++ b/CONTRIBUTORS.txt
@@ -164,3 +164,5 @@ Order doesn't matter (not that much, at least ;)
* Jason Owen: contributor
* Mitchell Young: minor adjustment to docparams
+
+* Michael Hudson-Doyle \ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index 64f0ec1e7..9a9d17a0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@ Release date: |TBA|
Close #2047
+ * Fix compatibility with changes to stdlib tokenizer.
+
What's New in Pylint 1.9.4?
===========================
diff --git a/pylint/checkers/format.py b/pylint/checkers/format.py
index b16a91a8a..f144e1380 100644
--- a/pylint/checkers/format.py
+++ b/pylint/checkers/format.py
@@ -871,8 +871,11 @@ class FormatChecker(BaseTokenChecker):
def _check_line_ending(self, line_ending, line_num):
# check if line endings are mixed
if self._last_line_ending is not None:
- if line_ending != self._last_line_ending:
- self.add_message('mixed-line-endings', line=line_num)
+ # line_ending == "" indicates a synthetic newline added at
+ # the end of a file that does not, in fact, end with a
+ # newline.
+ if line_ending and line_ending != self._last_line_ending:
+ self.add_message("mixed-line-endings", line=line_num)
self._last_line_ending = line_ending