Skip to content

Commit 4bb840a

Browse files
author
MarcoFalke
committed
Merge bitcoin/bitcoin#26802: test: Use same Python executable for subprocesses as for all-lint.py
f6eadaa Use same Python executable for subprocesses as for all-lint.py (Kristaps Kaupe) Pull request description: Before this all linters were ran by `/usr/bin/env python3`, no matter what was used to run `test/lint/all-lint.py`. This change allows to use non-default Python executable for `test/lint/all-lint.py` and then all subprocesses will also use same Python interpreter (for example, `python3.10 ./test/lint/all-lint.py`). See bitcoin/bitcoin#26792 (comment) as use case. ACKs for top commit: fanquake: ACK f6eadaa - did not test Tree-SHA512: 4da3b5581a0dd8ab9a6387829495019091a93a7ceaf2135d65d40a1983fd11a0b92b20891ef30d2a132abb0a690cd9b2f7eb5fcc38df06a340394ef449d640af
2 parents 2ec9782 + f6eadaa commit 4bb840a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/lint/all-lint.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
from glob import glob
1111
from pathlib import Path
1212
from subprocess import run
13+
from sys import executable
1314

1415
exit_code = 0
1516
mod_path = Path(__file__).parent
1617
for lint in glob(f"{mod_path}/lint-*.py"):
17-
result = run([lint])
18+
result = run([executable, lint])
1819
if result.returncode != 0:
1920
print(f"^---- failure generated from {lint.split('/')[-1]}")
2021
exit_code |= result.returncode

0 commit comments

Comments
 (0)