Skip to content

Commit

Permalink
Fix linterstats.get_module_message_count()
Browse files Browse the repository at this point in the history
  • Loading branch information
zasca authored Oct 12, 2023
1 parent 0796dfa commit afbbf17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pylint/utils/linterstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def get_global_message_count(self, type_name: str) -> int:

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

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

0 comments on commit afbbf17

Please sign in to comment.