[issue9202] Update platform.win32_ver() to account for change to #8413

Brian Curtin report at bugs.python.org
Thu Jul 8 17:05:03 CEST 2010


Brian Curtin <curtin at acm.org> added the comment:

The following little patch could do the trick.


--- platform.py	(revision 82643)
+++ platform.py	(working copy)
@@ -606,7 +606,9 @@
 
     # Find out the registry key and some general version infos
     winver = GetVersionEx()
-    maj,min,buildno,plat,csd = winver
+    # If sys.getwindowsversion in 3.2 gets used, it contains extra fields
+    # which don't get used. Always use slicing in order to stay compatible.
+    maj,min,buildno,plat,csd = winver[:5]
     version = '%i.%i.%i' % (maj,min,buildno & 0xFFFF)
     if hasattr(winver, "service_pack"):
         if winver.service_pack != "":

----------
components: +Library (Lib) -None
keywords: +needs review, patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9202>
_______________________________________


More information about the Python-bugs-list mailing list