mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-01 08:24:21 +01:00
test: detect OS consistently using platform.system()
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user