Skip to content

Commit 6a7686b

Browse files
committed
scripted-diff: Specify Python major version explicitly on Windows
Using `py.exe` launcher might by fragile depending on how Python was installed. Specifying the Python version explicitly fixes test errors like this: ``` RunCommandParseJSON error: process(py C:\Users\hebasto\bitcoin\test\functional\mocks\signer.py enumerate) returned 9009: Python was not found... ``` -BEGIN VERIFY SCRIPT- sed -i 's|"py "|"py -3 "|g' $(git grep -l '"py "' -- test/functional) -END VERIFY SCRIPT-
1 parent 7c66a4b commit 6a7686b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

test/functional/rpc_signer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class RPCSignerTest(BitcoinTestFramework):
2121
def mock_signer_path(self):
2222
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'signer.py')
2323
if platform.system() == "Windows":
24-
return "py " + path
24+
return "py -3 " + path
2525
else:
2626
return path
2727

test/functional/wallet_signer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ def add_options(self, parser):
2525
def mock_signer_path(self):
2626
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'signer.py')
2727
if platform.system() == "Windows":
28-
return "py " + path
28+
return "py -3 " + path
2929
else:
3030
return path
3131

3232
def mock_invalid_signer_path(self):
3333
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'invalid_signer.py')
3434
if platform.system() == "Windows":
35-
return "py " + path
35+
return "py -3 " + path
3636
else:
3737
return path
3838

3939
def mock_multi_signers_path(self):
4040
path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'multi_signers.py')
4141
if platform.system() == "Windows":
42-
return "py " + path
42+
return "py -3 " + path
4343
else:
4444
return path
4545

0 commit comments

Comments
 (0)