summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
authorBryce Guinta <bryce.guinta@protonmail.com>2018-07-24 00:28:13 -0600
committerClaudiu Popa <pcmanticore@gmail.com>2018-07-24 08:28:13 +0200
commit9f0ef30b13500ecba6f1b9f5c71981df976e7e6e (patch)
tree07fcd6caf262e2daf77fa77b8bd821e1f4f9f427 /pylint/utils.py
parent2b24ec063a5355648d286633e37f084ced4f1604 (diff)
downloadpylint-git-9f0ef30b13500ecba6f1b9f5c71981df976e7e6e.tar.gz
Fix not being able to disable certain messages on the last line (#2342)
Allow messages to be disabled that occur in ``file_state._msgs_state`` after the end of the ast (but not of the tokens) Close #2278
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index 441bd69e2..d5de04572 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -397,7 +397,8 @@ class MessagesHandlerMixIn:
# This happens for example with a commented line at the end of a module.
max_line_number = self.file_state.get_effective_max_line_number()
if (max_line_number and line > max_line_number):
- return msgid not in self.file_state._raw_module_msgs_state
+ fallback = msgid not in self.file_state._raw_module_msgs_state
+ return self._msgs_state.get(msgid, fallback)
return self._msgs_state.get(msgid, True)
def add_message(self, msg_descr, line=None, node=None, args=None, confidence=UNDEFINED,