summaryrefslogtreecommitdiff
path: root/pylint/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/utils.py')
-rw-r--r--pylint/utils.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pylint/utils.py b/pylint/utils.py
index 9119d1713..506dbf0ca 100644
--- a/pylint/utils.py
+++ b/pylint/utils.py
@@ -973,9 +973,11 @@ class MessagesStore:
:param str other_symbol: Other offending symbol
:raises InvalidMessageError: when a symbol is duplicated.
"""
+ symbols = [symbol, other_symbol]
+ symbols.sort()
error_message = "Message id '{msgid}' cannot have both ".format(msgid=msgid)
error_message += "'{other_symbol}' and '{symbol}' as symbolic name.".format(
- other_symbol=other_symbol, symbol=symbol
+ other_symbol=symbols[0], symbol=symbols[1]
)
raise InvalidMessageError(error_message)
@@ -988,11 +990,13 @@ class MessagesStore:
:param str other_msgid: Other offending msgid
:raises InvalidMessageError: when a msgid is duplicated.
"""
+ msgids = [msgid, other_msgid]
+ msgids.sort()
error_message = "Message symbol '{symbol}' cannot be used for ".format(
symbol=symbol
)
error_message += "'{other_msgid}' and '{msgid}' at the same time.".format(
- other_msgid=other_msgid, msgid=msgid
+ other_msgid=msgids[0], msgid=msgids[1]
)
raise InvalidMessageError(error_message)