[OSX] Fix converting mac_ver to string

This commit is contained in:
Calum Lind 2017-06-26 22:03:21 +01:00
parent d250e0a486
commit 065729a389
2 changed files with 16 additions and 5 deletions

View File

@ -229,14 +229,25 @@ def linux_check():
def get_os_version():
"""Parse and return the os version information.
Converts the platform ver tuple to a string.
Returns:
str: The os version info.
"""
if windows_check():
return platform.win32_ver()
os_version = platform.win32_ver()
elif osx_check():
return platform.mac_ver()
os_version = list(platform.mac_ver())
os_version[1] = '' # versioninfo always empty.
elif linux_check():
return platform.linux_distribution()
os_version = platform.linux_distribution()
else:
return (platform.release(), )
os_version = (platform.release(), )
return ' '.join(filter(None, os_version))
def get_pixmap(fname):

View File

@ -94,7 +94,7 @@ def get_version():
except ImportError:
pass
version_str += 'Python: %s\n' % platform.python_version()
version_str += 'OS: %s %s\n' % (platform.system(), ' '.join(common.get_os_version()))
version_str += 'OS: %s %s\n' % (platform.system(), common.get_os_version())
return version_str