mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-03 09:43:55 +02:00
qa: Use sys.executable when invoking other Python scripts
This change fixes tests on systems where `python3` is not available in the `PATH`, causing the shebang `#!/usr/bin/env python3` to fail.
This commit is contained in:
@@ -9,6 +9,7 @@ See also wallet_signer.py for tests that require wallet context.
|
||||
"""
|
||||
import os
|
||||
import platform
|
||||
import sys
|
||||
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
@@ -20,10 +21,7 @@ from test_framework.util import (
|
||||
class RPCSignerTest(BitcoinTestFramework):
|
||||
def mock_signer_path(self):
|
||||
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'signer.py')
|
||||
if platform.system() == "Windows":
|
||||
return "py -3 " + path
|
||||
else:
|
||||
return path
|
||||
return sys.executable + " " + path
|
||||
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 4
|
||||
|
||||
Reference in New Issue
Block a user