Skip to content

Commit 25223a9

Browse files
committed
pylint.Run accepts do_exit as a deprecated parameter
We need to allow various third party libraries that depend on `pylint` to still use `do_exit` until they can move over to `exit`. Close #3590
1 parent cfa61e9 commit 25223a9

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ChangeLog

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
Pylint's ChangeLog
33
------------------
44

5+
What's New in Pylint 2.5.2?
6+
===========================
7+
8+
Release date: TBA
9+
10+
* ``pylint.Run`` accepts ``do_exit`` as a deprecated parameter
11+
12+
Close #3590
13+
514
What's New in Pylint 2.5.1?
615
===========================
716

pylint/lint/run.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import os
55
import sys
6+
import warnings
67

78
from pylint import __pkginfo__, config, extensions, interfaces
89
from pylint.lint.pylinter import PyLinter
@@ -47,6 +48,9 @@ def cb_init_hook(optname, value):
4748
exec(value) # pylint: disable=exec-used
4849

4950

51+
UNUSED_PARAM_SENTINEL = object()
52+
53+
5054
class Run:
5155
"""helper class to use as main for pylint :
5256
@@ -67,7 +71,7 @@ def _return_one(*args): # pylint: disable=unused-argument
6771
return 1
6872

6973
def __init__(
70-
self, args, reporter=None, exit=True
74+
self, args, reporter=None, exit=True, do_exit=UNUSED_PARAM_SENTINEL,
7175
): # pylint: disable=redefined-builtin
7276
self._rcfile = None
7377
self._plugins = []
@@ -339,6 +343,14 @@ def __init__(
339343

340344
linter.check(args)
341345
score_value = linter.generate_reports()
346+
347+
if do_exit is not UNUSED_PARAM_SENTINEL:
348+
warnings.warn(
349+
"do_exit is deprecated and it is going to be removed in a future version.",
350+
DeprecationWarning,
351+
)
352+
exit = do_exit
353+
342354
if exit:
343355
if linter.config.exit_zero:
344356
sys.exit(0)

0 commit comments

Comments
 (0)