summaryrefslogtreecommitdiffstats
path: root/Lib/sysconfig
diff options
context:
space:
mode:
authorMalcolm Smith <smith@chaquo.com>2024-05-01 16:47:54 (GMT)
committerGitHub <noreply@github.com>2024-05-01 16:47:54 (GMT)
commit75955110a643875b5d096b6eda06dcc6e542e171 (patch)
tree580a21e484ac585bf155c23e3fa311dd073914af /Lib/sysconfig
parent6d12f4469c5f9e24809df28b19900722d52af11b (diff)
downloadcpython-75955110a643875b5d096b6eda06dcc6e542e171.zip
cpython-75955110a643875b5d096b6eda06dcc6e542e171.tar.gz
cpython-75955110a643875b5d096b6eda06dcc6e542e171.tar.bz2
gh-116622: Android sysconfig updates (#118352)
Diffstat (limited to 'Lib/sysconfig')
-rw-r--r--Lib/sysconfig/__init__.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 70bdecf..98a14e5 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -601,10 +601,22 @@ def get_platform():
machine = machine.replace('/', '-')
if osname[:5] == "linux":
- # At least on Linux/Intel, 'machine' is the processor --
- # i386, etc.
- # XXX what about Alpha, SPARC, etc?
- return f"{osname}-{machine}"
+ if sys.platform == "android":
+ osname = "android"
+ release = get_config_var("ANDROID_API_LEVEL")
+
+ # Wheel tags use the ABI names from Android's own tools.
+ machine = {
+ "x86_64": "x86_64",
+ "i686": "x86",
+ "aarch64": "arm64_v8a",
+ "armv7l": "armeabi_v7a",
+ }[machine]
+ else:
+ # At least on Linux/Intel, 'machine' is the processor --
+ # i386, etc.
+ # XXX what about Alpha, SPARC, etc?
+ return f"{osname}-{machine}"
elif osname[:5] == "sunos":
if release[0] >= "5": # SunOS 5 == Solaris 2
osname = "solaris"