summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
authorSylvain Thénault <thenault@gmail.com>2014-04-11 09:41:27 +0200
committerSylvain Thénault <thenault@gmail.com>2014-04-11 09:41:27 +0200
commitb4ec020784a8e827d9213f5096266e7785ec42cf (patch)
treecbd39e8c52f2b0e220ebba75b70a8cd00be67f1a /utils.py
parent1676b72f0adbb98fd314e3b043441301f71905b0 (diff)
parentfe8056767b6307475b3f69fe2aa339dd57a859da (diff)
downloadpylint-git-b4ec020784a8e827d9213f5096266e7785ec42cf.tar.gz
Merged in dnozay/pylint (pull request #87)
fix error with message reports when custom checker uses old-style messages
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index ce4fbd434..e1cb3a83a 100644
--- a/utils.py
+++ b/utils.py
@@ -414,6 +414,8 @@ class MessagesHandlerMixIn(object):
"""
msg_info = self.check_message_id(msg_descr)
msgid = msg_info.msgid
+ # backward compatibility, message may not have a symbol
+ symbol = msg_info.symbol or msgid
# Fatal messages and reports are special, the node/scope distinction
# does not apply to them.
if msgid[0] not in _SCOPE_EXEMPT:
@@ -441,9 +443,9 @@ class MessagesHandlerMixIn(object):
self.stats[msg_cat] += 1
self.stats['by_module'][self.current_name][msg_cat] += 1
try:
- self.stats['by_msg'][msg_info.symbol] += 1
+ self.stats['by_msg'][symbol] += 1
except KeyError:
- self.stats['by_msg'][msg_info.symbol] = 1
+ self.stats['by_msg'][symbol] = 1
# expand message ?
msg = msg_info.msg
if args: