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
# 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'``
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
raised when getting the attribute from the type dictionary are no longer
ignored. (Contributed by Serhiy Storchaka in :issue:`35459`.)
+* On AIX, :attr:`sys.platform` doesn't contain the major version anymore.
+ It is always ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``. Since
+ older Python versions include the version number, it is recommended to
+ always use the ``sys.platform.startswith('aix')``.
+ (Contributed by M. Felt in :issue:`36588`.)
Changes in the Python API
-------------------------
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ aix*) MACHDEP="aix";;
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
-
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.