Skip to content

Commit 93a4dc9

Browse files
committed
Define the variable in one place.
1 parent b413f91 commit 93a4dc9

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

distutils/_msvccompiler.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,28 @@ def _find_exe(exe, paths=None):
178178
return exe
179179

180180

181-
if get_host_platform() == "win-arm64":
182-
# Use the native MSVC host if the host platform would need expensive
183-
# emulation for x86.
184-
PLAT_TO_VCVARS = {
181+
PLAT_TO_VCVARS = (
182+
{
183+
# Use the native MSVC host if the host platform would need expensive
184+
# emulation for x86.
185185
'win32': 'arm64_x86',
186186
'win-amd64': 'arm64_amd64',
187187
'win-arm32': 'arm64_arm',
188188
'win-arm64': 'arm64',
189189
}
190-
else:
191-
# Always cross-compile from x86 to work with the lighter-weight MSVC
192-
# installs that do not include native 64-bit tools.
193-
PLAT_TO_VCVARS = {
190+
if get_host_platform() == "win-arm64"
191+
else {
192+
# Always cross-compile from x86 to work with the lighter-weight MSVC
193+
# installs that do not include native 64-bit tools.
194194
'win32': 'x86',
195195
'win-amd64': 'x86_amd64',
196196
'win-arm32': 'x86_arm',
197197
'win-arm64': 'x86_arm64',
198198
}
199+
)
200+
"""
201+
Maps get_platform() results to values expected by vcvarsall.bat.
202+
"""
199203

200204

201205
class MSVCCompiler(CCompiler):

0 commit comments

Comments
 (0)