Skip to content

Commit 84b07ff

Browse files
Add PreferredToolArchitecture env var back
1 parent 4755b8d commit 84b07ff

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

PCbuild/get_external.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ def fetch_zip(commit_hash, zip_dir, *, org='python', binary=False, verbose):
4545

4646

4747
def fetch_release(tag, tarball_dir, *, org='python', verbose=False):
48-
arch = platform.machine()
49-
arch = {'AMD64': 'x64', 'x86': 'x64'}.get(arch, arch)
48+
arch = os.environ.get('PreferredToolArchitecture')
49+
if not arch:
50+
machine = platform.machine()
51+
arch = 'ARM64' if machine == 'ARM64' else 'AMD64'
52+
elif arch in ('x86', 'x64'):
53+
arch = 'AMD64'
5054
reporthook = None
5155
if verbose:
5256
reporthook = print

0 commit comments

Comments
 (0)