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.
This commit is contained in:
2Shirt 2021-10-20 20:51:04 -06:00
parent 6a9299dea1
commit 98f3ebb49e
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

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