Steve Dower added the comment:

I've attached a replacement for the win32_ver function in platform.py that will 
get the actual version number from kernel32.dll's resources. Originally I was 
just writing a helper function, but it seemed easy enough to replace the entire 
function.

The attached function only really supports Python 3.5 as it assumes that the 
earliest Windows version will be Vista (6.0). The comments in platform.py 
suggest backwards compatibility is important for this file, so my win32_ver() 
may be a better reference for someone who wants to add this functionality in a 
backwards-compatible way. Though if it's okay for the stdlib platform.py to not 
support pre-3.5 this should be fine (and I'll do the extra work to make sure).

It's probably also easy to support 3.4 and Windows XP/WS2K3 as well, but I 
don't have any machines handy to test it.

As part of my patch for #23018, I'll add the manifest required so that 
GetVersionEx() will recognise 8.1 and 10.

----------
versions: +Python 3.5 -Python 3.3
Added file: http://bugs.python.org/file37578/win32_ver.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19143>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to