diff options
author | Eric Smith <eric@trueblade.com> | 2010-01-27 00:44:57 (GMT) |
---|---|---|
committer | Eric Smith <eric@trueblade.com> | 2010-01-27 00:44:57 (GMT) |
commit | f7bb57875acfd86a2864b3c305d90a083fa97fef (patch) | |
tree | ce1818640ff383a8a19886dd52a07b2b9fcb2b96 /Doc/library/sys.rst | |
parent | 38f0033601b74fb4eafc72047d9197eee7ab8704 (diff) | |
download | cpython-f7bb57875acfd86a2864b3c305d90a083fa97fef.zip cpython-f7bb57875acfd86a2864b3c305d90a083fa97fef.tar.gz cpython-f7bb57875acfd86a2864b3c305d90a083fa97fef.tar.bz2 |
Merged revisions 77763 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77763 | eric.smith | 2010-01-26 19:28:29 -0500 (Tue, 26 Jan 2010) | 1 line
Issue #7766: Change sys.getwindowsversion() return value to a named tuple and add the additional members returned in an OSVERSIONINFOEX structure. The new members are service_pack_major, service_pack_minor, suite_mask, and product_type.
........
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r-- | Doc/library/sys.rst | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst index 33910ae..1278248 100644 --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@ -394,9 +394,15 @@ always available. .. function:: getwindowsversion() - Return a tuple containing five components, describing the Windows version - currently running. The elements are *major*, *minor*, *build*, *platform*, and - *text*. *text* contains a string while all other values are integers. + Return a named tuple containing describing the Windows version + currently running. The named elements are *major*, *minor*, + *build*, *platform*, *service_pack*, *service_pack_minor*, + *service_pack_major*, *suite_mask*, and *product_type*. + *service_pack* contains a string while all other values are + integers. The components can also be accessed by name, so + ``sys.getwindowsversion()[0]`` is equivalent to + ``sys.getwindowsversion().major``. For compatibility with prior + versions, only the first 5 elements are retrievable by indexing. *platform* may be one of the following values: @@ -412,11 +418,30 @@ always available. | :const:`3 (VER_PLATFORM_WIN32_CE)` | Windows CE | +-----------------------------------------+-------------------------+ - This function wraps the Win32 :cfunc:`GetVersionEx` function; see the Microsoft - documentation for more information about these fields. + *product_type* may be one of the following values: + + +---------------------------------------+---------------------------------+ + | Constant | Meaning | + +=======================================+=================================+ + | :const:`1 (VER_NT_WORKSTATION)` | The system is a workstation. | + +---------------------------------------+---------------------------------+ + | :const:`2 (VER_NT_DOMAIN_CONTROLLER)` | The system is a domain | + | | controller. | + +---------------------------------------+---------------------------------+ + | :const:`3 (VER_NT_SERVER)` | The system is a server, but not | + | | a domain controller. | + +---------------------------------------+---------------------------------+ + + + This function wraps the Win32 :cfunc:`GetVersionEx` function; see the + Microsoft documentation on :cfunc:`OSVERSIONINFOEX` for more information + about these fields. Availability: Windows. + .. versionchanged:: 2.7 + Changed to a named tuple and added *service_pack_minor*, + *service_pack_major*, *suite_mask*, and *product_type*. .. data:: hexversion |