From c2815335df7d93040f9e867ec83bddde3952d0c9 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 21 Mar 2023 21:23:53 +0100 Subject: [PATCH 1/2] [deprecation] Message.location must be a 'MessageLocationTuple' --- doc/whatsnew/fragments/8476.internal | 4 ++++ pylint/message/message.py | 20 +------------------- 2 files changed, 5 insertions(+), 19 deletions(-) create mode 100644 doc/whatsnew/fragments/8476.internal diff --git a/doc/whatsnew/fragments/8476.internal b/doc/whatsnew/fragments/8476.internal new file mode 100644 index 0000000000..a784379870 --- /dev/null +++ b/doc/whatsnew/fragments/8476.internal @@ -0,0 +1,4 @@ +Following a deprecation period, the ``location`` argument of the +``Message`` class must now be a ``MessageLocationTuple``. + +Refs #8476 diff --git a/pylint/message/message.py b/pylint/message/message.py index 23dd6c082d..0fd02c369b 100644 --- a/pylint/message/message.py +++ b/pylint/message/message.py @@ -5,7 +5,6 @@ from __future__ import annotations from dataclasses import asdict, dataclass -from warnings import warn from pylint.constants import MSG_TYPES from pylint.interfaces import UNDEFINED, Confidence @@ -35,27 +34,10 @@ def __init__( self, msg_id: str, symbol: str, - location: tuple[str, str, str, str, int, int] | MessageLocationTuple, + location: MessageLocationTuple, msg: str, confidence: Confidence | None, ) -> None: - if not isinstance(location, MessageLocationTuple): - warn( - "In pylint 3.0, Messages will only accept a MessageLocationTuple as location parameter", - DeprecationWarning, - stacklevel=2, - ) - location = MessageLocationTuple( - location[0], - location[1], - location[2], - location[3], - location[4], - location[5], - None, - None, - ) - self.msg_id = msg_id self.symbol = symbol self.msg = msg From 8b44eb001af309cd68aef8f181b0be04f79bd229 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Tue, 21 Mar 2023 21:34:26 +0100 Subject: [PATCH 2/2] Proper issue number --- doc/whatsnew/fragments/{8476.internal => 8477.internal} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename doc/whatsnew/fragments/{8476.internal => 8477.internal} (91%) diff --git a/doc/whatsnew/fragments/8476.internal b/doc/whatsnew/fragments/8477.internal similarity index 91% rename from doc/whatsnew/fragments/8476.internal rename to doc/whatsnew/fragments/8477.internal index a784379870..d7b0435210 100644 --- a/doc/whatsnew/fragments/8476.internal +++ b/doc/whatsnew/fragments/8477.internal @@ -1,4 +1,4 @@ Following a deprecation period, the ``location`` argument of the ``Message`` class must now be a ``MessageLocationTuple``. -Refs #8476 +Refs #8477