Update getting MacOS version (#1409)

This commit is contained in:
Ross Scroggs
2021-08-14 13:59:07 -07:00
committed by GitHub
parent 1a9de867f9
commit 95beb8e62a
2 changed files with 20 additions and 12 deletions

View File

@ -728,8 +728,12 @@ def getOSPlatform():
elif myos == 'Darwin':
myos = 'MacOS'
mac_ver = platform.mac_ver()[0]
major_ver = int(mac_ver.split('.')[0]) # macver 10.14.6 == major_ver 10
minor_ver = int(mac_ver.split('.')[1]) # macver 10.14.6 == minor_ver 14
codename = MACOS_CODENAMES.get(minor_ver, '')
if major_ver == 10:
codename = MACOS_CODENAMES[major_ver].get(minor_ver, '')
else:
codename = MACOS_CODENAMES.get(major_ver, '')
pltfrm = ' '.join([codename, mac_ver])
else:
pltfrm = platform.platform()

View File

@ -616,6 +616,7 @@ GOOGLEDOC_VALID_EXTENSIONS_MAP = {
}
MACOS_CODENAMES = {
10: {
6: 'Snow Leopard',
7: 'Lion',
8: 'Mountain Lion',
@ -625,7 +626,10 @@ MACOS_CODENAMES = {
12: 'Sierra',
13: 'High Sierra',
14: 'Mojave',
15: 'Catalina'
15: 'Catalina',
16: 'Big Sur'
},
11: 'Big Sur',
}
_MICROSOFT_FORMATS_LIST = [{