From 98f3ebb49e5a1f7e674743a546f23d5d3d9538c2 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Wed, 20 Oct 2021 20:51:04 -0600 Subject: [PATCH] Change how OS_VERSION is set By only using the float type for 8.1 we can just print OS_VERSION to get 7, 8, 8.1, 10, and maybe 11? To future me, sorry if you decide to add type hints to the project. --- scripts/wk/os/win.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/wk/os/win.py b/scripts/wk/os/win.py index 92d91525..e6ad52a4 100644 --- a/scripts/wk/os/win.py +++ b/scripts/wk/os/win.py @@ -71,7 +71,8 @@ KNOWN_HIVE_NAMES = { winreg.HKEY_LOCAL_MACHINE: 'HKEY_LOCAL_MACHINE', winreg.HKEY_USERS: 'HKEY_USERS', } -OS_VERSION = float(platform.win32_ver()[0]) +OS_VERSION = platform.win32_ver()[0] +OS_VERSION = 8.1 if OS_VERSION == '8.1' else int(OS_VERSION) RAM_OK = 5.5 * 1024**3 # ~6 GiB assuming a bit of shared memory RAM_WARNING = 3.5 * 1024**3 # ~4 GiB assuming a bit of shared memory REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'