summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
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