File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change
1
+ Following a deprecation period, the ``py_version`` argument of the
2
+ ``MessageDefinition.may_be_emitted`` function is now required. The most likely solution
3
+ is to use 'linter.config.py_version' if you need to keep using this
4
+ function, or to use 'MessageDefinition.is_message_enabled' instead.
5
+
6
+ Refs #8473
Original file line number Diff line number Diff line change 5
5
from __future__ import annotations
6
6
7
7
import sys
8
- import warnings
9
8
from typing import TYPE_CHECKING , Any
10
9
11
10
from astroid import nodes
@@ -73,23 +72,8 @@ def __repr__(self) -> str:
73
72
def __str__ (self ) -> str :
74
73
return f"{ repr (self )} :\n { self .msg } { self .description } "
75
74
76
- def may_be_emitted (
77
- self ,
78
- py_version : tuple [int , ...] | sys ._version_info | None = None ,
79
- ) -> bool :
80
- """Return True if message may be emitted using the configured py_version."""
81
- if py_version is None :
82
- py_version = sys .version_info
83
- # TODO: 3.0
84
- warnings .warn (
85
- "'py_version' will be a required parameter of "
86
- "'MessageDefinition.may_be_emitted' in pylint 3.0. The most likely "
87
- "solution is to use 'linter.config.py_version' if you need to keep "
88
- "using this function, or to use 'MessageDefinition.is_message_enabled'"
89
- " instead." ,
90
- DeprecationWarning ,
91
- stacklevel = 2 ,
92
- )
75
+ def may_be_emitted (self , py_version : tuple [int , ...] | sys ._version_info ) -> bool :
76
+ """May the message be emitted using the configured py_version?"""
93
77
if self .minversion is not None and self .minversion > py_version :
94
78
return False
95
79
if self .maxversion is not None and self .maxversion <= py_version :
You can’t perform that action at this time.
0 commit comments