mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-24 10:18:51 +00:00
[OSX] Fix converting mac_ver to string
This commit is contained in:
parent
d250e0a486
commit
065729a389
@ -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):
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user