summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2011-09-04 06:42:26 (GMT)
committerGeorg Brandl <georg@python.org>2011-09-04 06:42:26 (GMT)
commitfbd1e041af2057065339bc643a00a55682427aa7 (patch)
tree04ed21f68370a28c0608c2a0925ac18feaa28971 /Doc/library/sys.rst
parentfd164c207f188e952125a0ce21a1fdec2b78170d (diff)
parent06ee0209614ea0d1a0801b673f1c5ee83b9ded5a (diff)
downloadcpython-fbd1e041af2057065339bc643a00a55682427aa7.zip
cpython-fbd1e041af2057065339bc643a00a55682427aa7.tar.gz
cpython-fbd1e041af2057065339bc643a00a55682427aa7.tar.bz2
Merge with 3.2.
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst7
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index d2986e4..acdde6d 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -710,6 +710,8 @@ always available.
if sys.platform.startswith('freebsd'):
# FreeBSD-specific code here...
+ elif sys.platform.startswith('linux'):
+ # Linux-specific code here...
For other systems, the values are:
@@ -726,7 +728,9 @@ always available.
.. versionchanged:: 3.3
On Linux, :attr:`sys.platform` doesn't contain the major version anymore.
- It is always ``'linux'``, instead of ``'linux2'`` or ``'linux3'``.
+ 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
@@ -735,6 +739,7 @@ always available.
The :mod:`platform` module provides detailed checks for the
system's identity.
+
.. data:: prefix
A string giving the site-specific directory prefix where the platform