@@ -1014,7 +1014,7 @@ always available.
1014
1014
This string contains a platform identifier that can be used to append
1015
1015
platform-specific components to :data: `sys.path `, for instance.
1016
1016
1017
- For Unix systems, except on Linux, this is the lowercased OS name as
1017
+ For Unix systems, except on Linux and AIX , this is the lowercased OS name as
1018
1018
returned by ``uname -s `` with the first part of the version as returned by
1019
1019
``uname -r `` appended, e.g. ``'sunos5' `` or ``'freebsd8' ``, *at the time
1020
1020
when Python was built *. Unless you want to test for a specific system
@@ -1024,12 +1024,15 @@ always available.
1024
1024
# FreeBSD-specific code here...
1025
1025
elif sys.platform.startswith('linux'):
1026
1026
# Linux-specific code here...
1027
+ elif sys.platform.startswith('aix'):
1028
+ # AIX-specific code here...
1027
1029
1028
1030
For other systems, the values are:
1029
1031
1030
1032
================ ===========================
1031
1033
System ``platform `` value
1032
1034
================ ===========================
1035
+ AIX ``'aix' ``
1033
1036
Linux ``'linux' ``
1034
1037
Windows ``'win32' ``
1035
1038
Windows/Cygwin ``'cygwin' ``
@@ -1042,6 +1045,12 @@ always available.
1042
1045
older Python versions include the version number, it is recommended to
1043
1046
always use the ``startswith `` idiom presented above.
1044
1047
1048
+ .. versionchanged :: 3.8
1049
+ On AIX, :attr: `sys.platform ` doesn't contain the major version anymore.
1050
+ It is always ``'aix' ``, instead of ``'aix5' `` or ``'aix7' ``. Since
1051
+ older Python versions include the version number, it is recommended to
1052
+ always use the ``startswith `` idiom presented above.
1053
+
1045
1054
.. seealso ::
1046
1055
1047
1056
:attr: `os.name ` has a coarser granularity. :func: `os.uname ` gives
0 commit comments