We've got a script that uses the platform module to detect OS version of our various clients.
Looking through the source for platform.py, I can see that on Windows systems, it's using sys.getwindowsverion(). Unfortunately, on Windows 8.1 systems, that particular function reports:
>>> sys.getwindowsversion()
sys.getwindowsversion(major=6, minor=2, build=9200, platform=2, service_pack='')
Windows 8.1 is 6.3.9600:
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
C:\Windows\system32>ver
Microsoft Windows [Version 6.3.9600]
So, I realize I could write some extra logic around my call to platform.release(), and if that returns 8, do a secondary check and try to run ver
, but that seems slightly convoluted.
Does anyone know of a better way?
Running ActivePython 2.7.2.5 in case that matters . . .