From 6a7686b44618eabd2f8ee9f1d357cfeb1bce6d91 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Thu, 3 Aug 2023 14:57:45 +0100 Subject: [PATCH] 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- --- test/functional/rpc_signer.py | 2 +- test/functional/wallet_signer.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/functional/rpc_signer.py b/test/functional/rpc_signer.py index 5ba0d358350..488682e9591 100755 --- a/test/functional/rpc_signer.py +++ b/test/functional/rpc_signer.py @@ -21,7 +21,7 @@ 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 " + path + return "py -3 " + path else: return path diff --git a/test/functional/wallet_signer.py b/test/functional/wallet_signer.py index 3e7c613e555..2735ec17069 100755 --- a/test/functional/wallet_signer.py +++ b/test/functional/wallet_signer.py @@ -25,21 +25,21 @@ class WalletSignerTest(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 " + path + return "py -3 " + path else: return path def mock_invalid_signer_path(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'invalid_signer.py') if platform.system() == "Windows": - return "py " + path + return "py -3 " + path else: return path def mock_multi_signers_path(self): path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'mocks', 'multi_signers.py') if platform.system() == "Windows": - return "py " + path + return "py -3 " + path else: return path