Skip to content

Commit 809a9a7

Browse files
Avasamjaraco
authored andcommitted
Fix cross-platform compilation using distutils._msvccompiler.MSVCCompiler.
Actually use the `plat_name` param in `MSVCCompiler.initialize`. Selective cherry-pick of pypa/distutils@a0339c1. Closes #4648.
1 parent 56fc311 commit 809a9a7

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

newsfragments/4648.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix cross-platform compilation using ``distutils._msvccompiler.MSVCCompiler`` -- by :user:`saschanaz` and :user:`Avasam`

setuptools/_distutils/_msvccompiler.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def initialize(self, plat_name=None):
284284
f"--plat-name must be one of {tuple(_vcvars_names)}"
285285
)
286286

287-
plat_spec = _get_vcvars_spec(get_host_platform(), get_platform())
287+
plat_spec = _get_vcvars_spec(get_host_platform(), plat_name)
288288

289289
vc_env = _get_vc_env(plat_spec)
290290
if not vc_env:

0 commit comments

Comments
 (0)