diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | pylint/epylint.py | 5 | ||||
-rw-r--r-- | pylint/test/test_regr.py | 1 |
3 files changed, 8 insertions, 2 deletions
@@ -7,6 +7,10 @@ What's New in Pylint 2.4.0? Release date: TBA +* ``epylint.py_run`` defaults to ``python`` in case the current executable is not a Python one. + + Close #2837 + * Ignore raw docstrings when running Similarities checker with `ignore-docstrings=yes` option * Fix crash when calling ``inherit_from_std_ex`` on a class which is its own ancestor diff --git a/pylint/epylint.py b/pylint/epylint.py index c2d4a21d8..8e246e55c 100755 --- a/pylint/epylint.py +++ b/pylint/epylint.py @@ -149,8 +149,11 @@ def py_run(command_options="", return_std=False, stdout=None, stderr=None): To silently run Pylint on a module, and get its standard output and error: >>> (pylint_stdout, pylint_stderr) = py_run( 'module_name.py', True) """ + # Detect if we use Python as executable or not, else default to `python` + executable = sys.executable if "python" in sys.executable else "python" + # Create command line to call pylint - epylint_part = [sys.executable, "-c", "from pylint import epylint;epylint.Run()"] + epylint_part = [executable, "-c", "from pylint import epylint;epylint.Run()"] options = shlex.split(command_options, posix=not sys.platform.startswith("win")) cli = epylint_part + options diff --git a/pylint/test/test_regr.py b/pylint/test/test_regr.py index 65e66eb20..e91d4464b 100644 --- a/pylint/test/test_regr.py +++ b/pylint/test/test_regr.py @@ -22,7 +22,6 @@ import astroid import pytest import pylint.testutils as testutils -from pylint import epylint REGR_DATA = join(dirname(abspath(__file__)), "regrtest_data") sys.path.insert(1, REGR_DATA) |