diff --git a/deluge/common.py b/deluge/common.py index 163e8ba03..e6b633d82 100644 --- a/deluge/common.py +++ b/deluge/common.py @@ -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): diff --git a/deluge/ui/baseargparser.py b/deluge/ui/baseargparser.py index cfafa9ad9..682f72fcf 100644 --- a/deluge/ui/baseargparser.py +++ b/deluge/ui/baseargparser.py @@ -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