From 283dae6d8d3f234a74f3834daea6ca21f3f25b87 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 14 Apr 2005 16:15:15 +0000 Subject: [PATCH] use os.sys.getwindowsversion cause platform.release does bad detection --- Core/core.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Core/core.py b/Core/core.py index 427110341..280aefe57 100644 --- a/Core/core.py +++ b/Core/core.py @@ -63,9 +63,25 @@ distro_info = { } def get_os_info(): - if os.name =='nt': - import platform - win_version = platform.release() + if os.name == 'nt': + #import platform + #win_version = platform.release() + #if win_version == '': + # unimport platform module + #del sys.modules['platform'] + #print sys.getrefcount(platform) # must be 2 to be safe! + #del platform # but also del all refs to its internals! + + win_version = {(1, 4, 0): '95',\ + (1, 4, 10): '98',\ + (1, 4, 90): 'ME',\ + (2, 4, 0): 'NT',\ + (2, 5, 0): '2000',\ + (2, 5, 1): 'XP' + }[ os.sys.getwindowsversion()[3],\ + os.sys.getwindowsversion()[0],\ + os.sys.getwindowsversion()[1] ] + return 'Windows' + ' ' + win_version elif os.name =='posix': executable = 'lsb_release'