diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-31 20:51:18 -0400 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-08-31 21:11:24 -0400 |
| commit | 467915b93d3965a7bad42a4e3ec6ce49843f874b (patch) | |
| tree | af243178e85b469a7d33811f460859f497da8ed5 | |
| parent | db20067e06d0463c0e071113b981cf5a08082f79 (diff) | |
| download | python-setuptools-git-467915b93d3965a7bad42a4e3ec6ce49843f874b.tar.gz | |
Restore compatibility with aix_support on Python 3.8 and earlier. Fixes pypa/setuptools#2358.
| -rw-r--r-- | distutils/py38compat.py | 7 | ||||
| -rw-r--r-- | distutils/util.py | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/distutils/py38compat.py b/distutils/py38compat.py new file mode 100644 index 00000000..fa9ba73f --- /dev/null +++ b/distutils/py38compat.py @@ -0,0 +1,7 @@ +def aix_platform(osname, version, release): + try: + import _aix_support + return _aix_support.aix_platform() + except ImportError: + pass + return "%s-%s.%s" % (osname, version, release) diff --git a/distutils/util.py b/distutils/util.py index 4b002ece..9d6c5cbd 100644 --- a/distutils/util.py +++ b/distutils/util.py @@ -79,8 +79,8 @@ def get_host_platform(): machine += ".%s" % bitness[sys.maxsize] # fall through to standard osname-release-machine representation elif osname[:3] == "aix": - from _aix_support import aix_platform - return aix_platform() + from .py38compat import aix_platform + return aix_platform(osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile (r'[\d.]+', re.ASCII) |
