Skip to content

Commit d659575

Browse files
[deprecation] Remove 'do_exit' from the 'Run' constructor (#8472)
1 parent 77a392d commit d659575

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

doc/whatsnew/fragments/8472.internal

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Following a deprecation period, the ``do_exit`` argument of the ``Run`` class (and of the ``_Run``
2+
class in testutils) were removed.
3+
4+
Refs #8472

pylint/lint/run.py

+1-15
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import warnings
1010
from collections.abc import Sequence
1111
from pathlib import Path
12-
from typing import Any, ClassVar
12+
from typing import ClassVar
1313

1414
from pylint import config
1515
from pylint.checkers.utils import clear_lru_caches
@@ -97,9 +97,6 @@ def _cpu_count() -> int:
9797
return cpu_count
9898

9999

100-
UNUSED_PARAM_SENTINEL = object()
101-
102-
103100
class Run:
104101
"""Helper class to use as main for pylint with 'run(*sys.argv[1:])'."""
105102

@@ -123,7 +120,6 @@ def __init__(
123120
args: Sequence[str],
124121
reporter: BaseReporter | None = None,
125122
exit: bool = True, # pylint: disable=redefined-builtin
126-
do_exit: Any = UNUSED_PARAM_SENTINEL,
127123
) -> None:
128124
# Immediately exit if user asks for version
129125
if "--version" in args:
@@ -215,16 +211,6 @@ def __init__(
215211
else:
216212
linter.check(args)
217213
score_value = linter.generate_reports()
218-
219-
if do_exit is not UNUSED_PARAM_SENTINEL:
220-
# TODO: 3.0
221-
warnings.warn(
222-
"do_exit is deprecated and it is going to be removed in a future version.",
223-
DeprecationWarning,
224-
stacklevel=2,
225-
)
226-
exit = do_exit
227-
228214
if linter.config.clear_cache_post_run:
229215
clear_lru_caches()
230216
MANAGER.clear_cache()

pylint/testutils/_run.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@
1010
from __future__ import annotations
1111

1212
from collections.abc import Sequence
13-
from typing import Any
1413

1514
from pylint.lint import Run as LintRun
16-
from pylint.lint.run import UNUSED_PARAM_SENTINEL
1715
from pylint.reporters.base_reporter import BaseReporter
1816
from pylint.testutils.lint_module_test import PYLINTRC
1917

@@ -39,7 +37,6 @@ def __init__(
3937
args: Sequence[str],
4038
reporter: BaseReporter | None = None,
4139
exit: bool = True, # pylint: disable=redefined-builtin
42-
do_exit: Any = UNUSED_PARAM_SENTINEL,
4340
) -> None:
4441
args = _add_rcfile_default_pylintrc(list(args))
45-
super().__init__(args, reporter, exit, do_exit)
42+
super().__init__(args, reporter, exit)

0 commit comments

Comments
 (0)