summaryrefslogtreecommitdiffstats
path: root/Doc/library/sys.rst
diff options
context:
space:
mode:
authorMichael Felt <aixtools@users.noreply.github.com>2019-04-12 14:15:32 (GMT)
committerVictor Stinner <vstinner@redhat.com>2019-04-12 14:15:32 (GMT)
commit9d949f7796da612f1b588d18c6f041376992a9fc (patch)
tree63decb39986d71d9f431cf17d8806e511126b7a2 /Doc/library/sys.rst
parent9b8314cfe29ca532fc335277f6c36b72e6132922 (diff)
downloadcpython-9d949f7796da612f1b588d18c6f041376992a9fc.zip
cpython-9d949f7796da612f1b588d18c6f041376992a9fc.tar.gz
cpython-9d949f7796da612f1b588d18c6f041376992a9fc.tar.bz2
bpo-36588: On AIX, remove major version from sys.platform (GH-12787)
On AIX, sys.platform doesn't contain the major version anymore. Always return 'aix', instead of 'aix3' .. 'aix7'. Since older Python versions include the version number, it is recommended to always use sys.platform.startswith('aix').
Diffstat (limited to 'Doc/library/sys.rst')
-rw-r--r--Doc/library/sys.rst11
1 files changed, 10 insertions, 1 deletions
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 52026f6..591972e 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -1014,7 +1014,7 @@ always available.
This string contains a platform identifier that can be used to append
platform-specific components to :data:`sys.path`, for instance.
- For Unix systems, except on Linux, this is the lowercased OS name as
+ For Unix systems, except on Linux and AIX, this is the lowercased OS name as
returned by ``uname -s`` with the first part of the version as returned by
``uname -r`` appended, e.g. ``'sunos5'`` or ``'freebsd8'``, *at the time
when Python was built*. Unless you want to test for a specific system
@@ -1024,12 +1024,15 @@ always available.
# FreeBSD-specific code here...
elif sys.platform.startswith('linux'):
# Linux-specific code here...
+ elif sys.platform.startswith('aix'):
+ # AIX-specific code here...
For other systems, the values are:
================ ===========================
System ``platform`` value
================ ===========================
+ AIX ``'aix'``
Linux ``'linux'``
Windows ``'win32'``
Windows/Cygwin ``'cygwin'``
@@ -1042,6 +1045,12 @@ always available.
older Python versions include the version number, it is recommended to
always use the ``startswith`` idiom presented above.
+ .. versionchanged:: 3.8
+ On AIX, :attr:`sys.platform` doesn't contain the major version anymore.
+ It is always ``'aix'``, instead of ``'aix5'`` or ``'aix7'``. 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