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/lint | |
parent | d4a8b028d6b982e4756ab0daa7cbea137c296db7 (diff) | |
download | pylint-git-95a82dc7ef54070e31dcecf56f2ded5348e3dfb7.tar.gz |
Add explicit 'stack_level' keyword in Deprecation/User warnings
Diffstat (limited to 'pylint/lint')
-rw-r--r-- | pylint/lint/caching.py | 1 | ||||
-rw-r--r-- | pylint/lint/run.py | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/pylint/lint/caching.py b/pylint/lint/caching.py index 8ea8a2236..feffac656 100644 --- a/pylint/lint/caching.py +++ b/pylint/lint/caching.py @@ -45,6 +45,7 @@ def load_results( "You're using an old pylint cache with invalid data following " f"an upgrade, please delete '{data_file}'.", UserWarning, + stacklevel=2, ) raise TypeError return data diff --git a/pylint/lint/run.py b/pylint/lint/run.py index 49b807f87..7c2e8c0e6 100644 --- a/pylint/lint/run.py +++ b/pylint/lint/run.py @@ -175,6 +175,7 @@ group are mutually exclusive.", warnings.warn( "NOTE: The 'pylint-config' command is experimental and usage can change", UserWarning, + stacklevel=2, ) code = _handle_pylint_config_commands(linter) if exit: @@ -216,9 +217,11 @@ group are mutually exclusive.", score_value = linter.generate_reports() if do_exit is not UNUSED_PARAM_SENTINEL: + # TODO: 3.0 warnings.warn( "do_exit is deprecated and it is going to be removed in a future version.", DeprecationWarning, + stacklevel=2, ) exit = do_exit |