aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-01-04 13:53:19 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-01-04 13:53:27 +0100
commit4bb840a453118360c0d91e9d191c4821b841de20 (patch)
treed3e27bd2ef385736e014ca933a5f01bdf052cc5b
parent2ec97825e70882262ee2b7d53dc1def788a60162 (diff)
parentf6eadaa413f20c1853cf1bea5141560cd5e4b15a (diff)
Merge bitcoin/bitcoin#26802: test: Use same Python executable for subprocesses as for `all-lint.py`
f6eadaa413f20c1853cf1bea5141560cd5e4b15a 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 https://github.com/bitcoin/bitcoin/issues/26792#issuecomment-1369558866 as use case. ACKs for top commit: fanquake: ACK f6eadaa413f20c1853cf1bea5141560cd5e4b15a - did not test Tree-SHA512: 4da3b5581a0dd8ab9a6387829495019091a93a7ceaf2135d65d40a1983fd11a0b92b20891ef30d2a132abb0a690cd9b2f7eb5fcc38df06a340394ef449d640af
-rwxr-xr-xtest/lint/all-lint.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/lint/all-lint.py b/test/lint/all-lint.py
index 34a7b9742a..c7889796c6 100755
--- a/test/lint/all-lint.py
+++ b/test/lint/all-lint.py
@@ -10,11 +10,12 @@
from glob import glob
from pathlib import Path
from subprocess import run
+from sys import executable
exit_code = 0
mod_path = Path(__file__).parent
for lint in glob(f"{mod_path}/lint-*.py"):
- result = run([lint])
+ result = run([executable, lint])
if result.returncode != 0:
print(f"^---- failure generated from {lint.split('/')[-1]}")
exit_code |= result.returncode