diff options
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-x | test/functional/test_framework/p2p.py | 3 | ||||
-rwxr-xr-x | test/functional/test_framework/test_node.py | 4 | ||||
-rw-r--r-- | test/functional/test_framework/util.py | 6 |
3 files changed, 7 insertions, 6 deletions
diff --git a/test/functional/test_framework/p2p.py b/test/functional/test_framework/p2p.py index b1ed97b794..34fe467d23 100755 --- a/test/functional/test_framework/p2p.py +++ b/test/functional/test_framework/p2p.py @@ -24,6 +24,7 @@ import asyncio from collections import defaultdict from io import BytesIO import logging +import platform import struct import sys import threading @@ -592,7 +593,7 @@ class NetworkThread(threading.Thread): NetworkThread.listeners = {} NetworkThread.protos = {} - if sys.platform == 'win32': + if platform.system() == 'Windows': asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) NetworkThread.network_event_loop = asyncio.new_event_loop() diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 90c1213deb..c6465f0346 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -12,6 +12,7 @@ import http.client import json import logging import os +import platform import re import subprocess import tempfile @@ -19,7 +20,6 @@ import time import urllib.parse import collections import shlex -import sys from pathlib import Path from .authproxy import ( @@ -567,7 +567,7 @@ class TestNode(): cmd, shell=True, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL) == 0 - if not sys.platform.startswith('linux'): + if platform.system() != 'Linux': self.log.warning("Can't profile with perf; only available on Linux platforms") return None diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index c65e3e38e6..b4b05b1597 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -13,8 +13,8 @@ import json import logging import os import pathlib +import platform import re -import sys import time from . import coverage @@ -414,12 +414,12 @@ def get_temp_default_datadir(temp_dir: pathlib.Path) -> tuple[dict, pathlib.Path """Return os-specific environment variables that can be set to make the GetDefaultDataDir() function return a datadir path under the provided temp_dir, as well as the complete path it would return.""" - if sys.platform == "win32": + if platform.system() == "Windows": env = dict(APPDATA=str(temp_dir)) datadir = temp_dir / "Bitcoin" else: env = dict(HOME=str(temp_dir)) - if sys.platform == "darwin": + if platform.system() == "Darwin": datadir = temp_dir / "Library/Application Support/Bitcoin" else: datadir = temp_dir / ".bitcoin" |