From 2abc302ce98958b565de5c5132d7c05558809ddd Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Fri, 21 Oct 2005 17:00:37 +0000 Subject: [PATCH] do not fail if user runs vista --- src/common/connection.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 1543cbc03..45411e195 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -89,6 +89,8 @@ distro_info = { def get_os_info(): if os.name == 'nt': + ver = os.sys.getwindowsversion() + ver_format = ver[3], ver[0], ver[1] win_version = { (1, 4, 0): '95', (1, 4, 10): '98', @@ -97,10 +99,11 @@ def get_os_info(): (2, 5, 0): '2000', (2, 5, 1): 'XP', (2, 5, 2): '2003' - }[ os.sys.getwindowsversion()[3], - os.sys.getwindowsversion()[0], - os.sys.getwindowsversion()[1] ] - return 'Windows' + ' ' + win_version + } + if win_version.has_key(ver_format): + return 'Windows' + ' ' + win_version[ver_format] + else: + return 'Windows' elif os.name == 'posix': executable = 'lsb_release' params = ' --id --codename --release --short'