Skip to content

Commit b59009a

Browse files
[deprecation] Message.location must be a 'MessageLocationTuple' (#8477)
1 parent 81520ad commit b59009a

File tree

2 files changed

+5
-19
lines changed

2 files changed

+5
-19
lines changed

doc/whatsnew/fragments/8477.internal

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Following a deprecation period, the ``location`` argument of the
2+
``Message`` class must now be a ``MessageLocationTuple``.
3+
4+
Refs #8477

pylint/message/message.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import annotations
66

77
from dataclasses import asdict, dataclass
8-
from warnings import warn
98

109
from pylint.constants import MSG_TYPES
1110
from pylint.interfaces import UNDEFINED, Confidence
@@ -35,27 +34,10 @@ def __init__(
3534
self,
3635
msg_id: str,
3736
symbol: str,
38-
location: tuple[str, str, str, str, int, int] | MessageLocationTuple,
37+
location: MessageLocationTuple,
3938
msg: str,
4039
confidence: Confidence | None,
4140
) -> None:
42-
if not isinstance(location, MessageLocationTuple):
43-
warn(
44-
"In pylint 3.0, Messages will only accept a MessageLocationTuple as location parameter",
45-
DeprecationWarning,
46-
stacklevel=2,
47-
)
48-
location = MessageLocationTuple(
49-
location[0],
50-
location[1],
51-
location[2],
52-
location[3],
53-
location[4],
54-
location[5],
55-
None,
56-
None,
57-
)
58-
5941
self.msg_id = msg_id
6042
self.symbol = symbol
6143
self.msg = msg

0 commit comments

Comments
 (0)