test: detect OS consistently using platform.system()

This commit is contained in:
Sebastian Falbesoner
2023-12-08 17:30:19 +01:00
parent 37324ae3df
commit 4c65ac96f8
9 changed files with 24 additions and 20 deletions

View File

@@ -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"