diff options
author | Paul Monson <paulmon@users.noreply.github.com> | 2019-04-25 18:36:45 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@python.org> | 2019-04-25 18:36:45 (GMT) |
commit | 62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c (patch) | |
tree | f59fcebb25702acbde504865f1a483ab7ac80954 /Lib/distutils/util.py | |
parent | 8c3ecc6bacc8d0cd534f2b5b53ed962dd1368c7b (diff) | |
download | cpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.zip cpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.tar.gz cpython-62dfd7d6fe11bfa0cd1d7376382c8e7b1275e38c.tar.bz2 |
bpo-35920: Windows 10 ARM32 platform support (GH-11774)
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 15cd2ad..50550e1 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -15,7 +15,7 @@ from distutils.spawn import spawn from distutils import log from distutils.errors import DistutilsByteCompileError -def get_platform (): +def get_host_platform(): """Return a string that identifies the current platform. This is used mainly to distinguish platform-specific build directories and platform-specific built distributions. Typically includes the OS name and version and the @@ -38,6 +38,8 @@ def get_platform (): if os.name == 'nt': if 'amd64' in sys.version.lower(): return 'win-amd64' + if '(arm)' in sys.version.lower(): + return 'win-arm32' return sys.platform # Set for cross builds explicitly @@ -90,8 +92,16 @@ def get_platform (): return "%s-%s-%s" % (osname, release, machine) -# get_platform () - +def get_platform(): + if os.name == 'nt': + TARGET_TO_PLAT = { + 'x86' : 'win32', + 'x64' : 'win-amd64', + 'arm' : 'win-arm32', + } + return TARGET_TO_PLAT.get(os.environ.get('VSCMD_ARG_TGT_ARCH')) or get_host_platform() + else: + return get_host_platform() def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, |