From: Georg Brandl Date: Thu, 23 Feb 2012 20:17:27 +0000 (+0100) Subject: merge with 3.2 X-Git-Tag: v3.3.0a1~81^2~2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=335d628a6673f0c44f13b4ea9f996cfc4539f3d5;p=python merge with 3.2 --- 335d628a6673f0c44f13b4ea9f996cfc4539f3d5 diff --cc Doc/library/sys.rst index 3af43543c4,0e4adeca76..da87be74ed --- a/Doc/library/sys.rst +++ b/Doc/library/sys.rst @@@ -736,26 -729,28 +736,27 @@@ always available elif sys.platform.startswith('linux'): # Linux-specific code here... - .. versionchanged:: 3.2.2 - Since lots of code check for ``sys.platform == 'linux2'``, and there is - no essential change between Linux 2.x and 3.x, ``sys.platform`` is always - set to ``'linux2'``, even on Linux 3.x. In Python 3.3 and later, the - value will always be set to ``'linux'``, so it is recommended to always - use the ``startswith`` idiom presented above. - For other systems, the values are: - ====================== =========================== - System :data:`platform` value - ====================== =========================== - Linux (2.x *and* 3.x) ``'linux2'`` - Windows ``'win32'`` - Windows/Cygwin ``'cygwin'`` - Mac OS X ``'darwin'`` - OS/2 ``'os2'`` - OS/2 EMX ``'os2emx'`` - ====================== =========================== + ================ =========================== + System :data:`platform` value + ================ =========================== + Linux ``'linux'`` + Windows ``'win32'`` + Windows/Cygwin ``'cygwin'`` + Mac OS X ``'darwin'`` + OS/2 ``'os2'`` + OS/2 EMX ``'os2emx'`` + ================ =========================== + + .. versionchanged:: 3.3 + On Linux, :attr:`sys.platform` doesn't contain the major version anymore. + It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``. Since + older Python versions include the version number, it is recommended to + always use the ``startswith`` idiom presented above. .. seealso:: + :attr:`os.name` has a coarser granularity. :func:`os.uname` gives system-dependent version information.