Skip to content

Commit b4f82b3

Browse files
MarcoFalkeknst
authored andcommitted
Merge 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#26792 (comment) as use case. ACKs for top commit: fanquake: ACK f6eadaa - did not test Tree-SHA512: 4da3b5581a0dd8ab9a6387829495019091a93a7ceaf2135d65d40a1983fd11a0b92b20891ef30d2a132abb0a690cd9b2f7eb5fcc38df06a340394ef449d640af
1 parent 88913fb commit b4f82b3

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
@@ -12,6 +12,7 @@
1212
from pathlib import Path
1313
from shutil import which
1414
from subprocess import run
15+
from sys import executable
1516

1617
exit_code = 0
1718
mod_path = Path(__file__).parent
@@ -28,7 +29,7 @@
2829
remove(logfile)
2930
else:
3031
for lint in lints:
31-
result = run([lint])
32+
result = run([executable, lint])
3233
if result.returncode != 0:
3334
print(f"^---- failure generated from {lint.split('/')[-1]}")
3435
exit_code |= result.returncode

0 commit comments

Comments
 (0)