Skip to content

Commit afbbf17

Browse files
authored
Fix linterstats.get_module_message_count()
Fix #9145
1 parent 0796dfa commit afbbf17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pylint/utils/linterstats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def get_global_message_count(self, type_name: str) -> int:
294294

295295
def get_module_message_count(self, modname: str, type_name: str) -> int:
296296
"""Get a module message count."""
297-
return getattr(self.by_module[modname], type_name, 0)
297+
return self.by_module[modname].get(type_name, 0)
298298

299299
def increase_single_message_count(self, type_name: str, increase: int) -> None:
300300
"""Increase the message type count of an individual message type."""

0 commit comments

Comments
 (0)