linter: Use same Python interpreter when executing script in subprocess

If a specific Python interpreter is used (e.g. by invoking the script with
"/path/to/python run.py") then we should use the same Python interpreter
to execute scripts in subprocesses, not the one from the environment.

The path to the running Python interpreter is given by sys.executable.
This commit is contained in:
Philip Chimento 2023-02-13 12:34:41 -08:00 committed by Ms2ger
parent d216cc1972
commit 6e1b737357
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class TestLinter(unittest.TestCase):
return fspath
def lint(self, args):
args[:0] = [ex]
args[:0] = [sys.executable, ex]
sp = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,