diff options
author | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-21 09:00:23 +0100 |
---|---|---|
committer | Pierre Sassoulas <pierre.sassoulas@gmail.com> | 2023-03-21 09:17:44 +0100 |
commit | 95a82dc7ef54070e31dcecf56f2ded5348e3dfb7 (patch) | |
tree | 8418c2e5fe83438729e27d46863899f66b2e9a56 /pylint/checkers | |
parent | d4a8b028d6b982e4756ab0daa7cbea137c296db7 (diff) | |
download | pylint-git-95a82dc7ef54070e31dcecf56f2ded5348e3dfb7.tar.gz |
Add explicit 'stack_level' keyword in Deprecation/User warnings
Diffstat (limited to 'pylint/checkers')
-rw-r--r-- | pylint/checkers/similar.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pylint/checkers/similar.py b/pylint/checkers/similar.py index e90a4154e..f738df263 100644 --- a/pylint/checkers/similar.py +++ b/pylint/checkers/similar.py @@ -848,12 +848,14 @@ class SimilarChecker(BaseRawFileChecker, Similar): stream must implement the readlines method """ if self.linter.current_name is None: + # TODO: 3.0 Fix current_name warnings.warn( ( "In pylint 3.0 the current_name attribute of the linter object should be a string. " "If unknown it should be initialized as an empty string." ), DeprecationWarning, + stacklevel=2, ) with node.stream() as stream: self.append_stream(self.linter.current_name, stream, node.file_encoding) |