mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
[OSX] Fix converting mac_ver to string
This commit is contained in:
parent
d250e0a486
commit
065729a389
2 changed files with 16 additions and 5 deletions
|
@ -229,14 +229,25 @@ def linux_check():
|
||||||
|
|
||||||
|
|
||||||
def get_os_version():
|
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():
|
if windows_check():
|
||||||
return platform.win32_ver()
|
os_version = platform.win32_ver()
|
||||||
elif osx_check():
|
elif osx_check():
|
||||||
return platform.mac_ver()
|
os_version = list(platform.mac_ver())
|
||||||
|
os_version[1] = '' # versioninfo always empty.
|
||||||
elif linux_check():
|
elif linux_check():
|
||||||
return platform.linux_distribution()
|
os_version = platform.linux_distribution()
|
||||||
else:
|
else:
|
||||||
return (platform.release(), )
|
os_version = (platform.release(), )
|
||||||
|
|
||||||
|
return ' '.join(filter(None, os_version))
|
||||||
|
|
||||||
|
|
||||||
def get_pixmap(fname):
|
def get_pixmap(fname):
|
||||||
|
|
|
@ -94,7 +94,7 @@ def get_version():
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
version_str += 'Python: %s\n' % platform.python_version()
|
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
|
return version_str
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue