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

@@ -17,6 +17,7 @@ from collections import deque
import configparser
import datetime
import os
import platform
import time
import shutil
import signal
@@ -42,8 +43,8 @@ except UnicodeDecodeError:
CROSS = "x "
CIRCLE = "o "
if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
if os.name == 'nt':
if platform.system() != 'Windows' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
if platform.system() == 'Windows':
import ctypes
kernel32 = ctypes.windll.kernel32 # type: ignore
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4