From 0b0ff4f0c1620f0ffa122605e5d037c04aca7a3c Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 28 Dec 2021 16:12:55 +0100 Subject: [PATCH] Get the msgid directly from the MessageIdStore We don't need to create message definitions to get their msgids. The level of indirection may suggest we need to refactor a little here. Maybe we actually need message definition only when we want to display the messages. --- pylint/lint/pylinter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pylint/lint/pylinter.py b/pylint/lint/pylinter.py index e46577615a..b0595a17b7 100644 --- a/pylint/lint/pylinter.py +++ b/pylint/lint/pylinter.py @@ -1435,8 +1435,7 @@ def is_message_enabled( if confidence.name not in self.config.confidence: return False try: - message_definitions = self.msgs_store.get_message_definitions(msg_descr) - msgids = [md.msgid for md in message_definitions] + msgids = self.msgs_store.message_id_store.get_active_msgids(msg_descr) except exceptions.UnknownMessageError: # The linter checks for messages that are not registered # due to version mismatch, just treat them as message IDs