Skip to content

Commit bf47448

Browse files
committed
test: drop check for Windows < 10
1 parent 35b898c commit bf47448

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

test/functional/test_runner.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@
5151
CROSS = "x "
5252
CIRCLE = "o "
5353

54-
if platform.system() != 'Windows' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
55-
if platform.system() == 'Windows':
56-
import ctypes
57-
kernel32 = ctypes.windll.kernel32 # type: ignore
58-
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
59-
STD_OUTPUT_HANDLE = -11
60-
STD_ERROR_HANDLE = -12
61-
# Enable ascii color control to stdout
62-
stdout = kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
63-
stdout_mode = ctypes.c_int32()
64-
kernel32.GetConsoleMode(stdout, ctypes.byref(stdout_mode))
65-
kernel32.SetConsoleMode(stdout, stdout_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
66-
# Enable ascii color control to stderr
67-
stderr = kernel32.GetStdHandle(STD_ERROR_HANDLE)
68-
stderr_mode = ctypes.c_int32()
69-
kernel32.GetConsoleMode(stderr, ctypes.byref(stderr_mode))
70-
kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
54+
if platform.system() == 'Windows':
55+
import ctypes
56+
kernel32 = ctypes.windll.kernel32 # type: ignore
57+
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4
58+
STD_OUTPUT_HANDLE = -11
59+
STD_ERROR_HANDLE = -12
60+
# Enable ascii color control to stdout
61+
stdout = kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
62+
stdout_mode = ctypes.c_int32()
63+
kernel32.GetConsoleMode(stdout, ctypes.byref(stdout_mode))
64+
kernel32.SetConsoleMode(stdout, stdout_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
65+
# Enable ascii color control to stderr
66+
stderr = kernel32.GetStdHandle(STD_ERROR_HANDLE)
67+
stderr_mode = ctypes.c_int32()
68+
kernel32.GetConsoleMode(stderr, ctypes.byref(stderr_mode))
69+
kernel32.SetConsoleMode(stderr, stderr_mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)
70+
else:
7171
# primitive formatting on supported
7272
# terminal via ANSI escape sequences:
7373
DEFAULT = ('\033[0m', '\033[0m')

0 commit comments

Comments
 (0)