Commit d63344e
committed
gh-154200: Use sysconfig.get_platform() in test_importlib.test_windows
test_tagged_suffix computed its expected extension suffix with a vendored port of
distutils.util.get_platform() that sniffs sys.version for 'amd64'. Python/getversion.c
truncates the compiler segment of sys.version at 80 characters, so on clang-cl builds --
whose banner carries a long __clang_version__ -- the marker is cut off, the helper falls
through to sys.platform ('win32'), and the test expects '.cp316t-win32.pyd' while the
interpreter correctly reports '.cp316t-win_amd64.pyd'.
sysconfig.get_platform() no longer parses sys.version on Windows (gh-145410); it uses the
_sysconfig C accelerator, which derives the platform from compile-time architecture
macros and is compiler-agnostic. Use it and drop the vendored copy, its only caller.
This also removes the VSCMD_ARG_TGT_ARCH branch, which trusted the ambient Visual Studio
target architecture over the interpreter actually running the test.1 parent 40f7fbf commit d63344e
1 file changed
Lines changed: 2 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 21 | | |
40 | 22 | | |
41 | 23 | | |
| |||
143 | 125 | | |
144 | 126 | | |
145 | 127 | | |
146 | | - | |
| 128 | + | |
147 | 129 | | |
148 | 130 | | |
149 | 131 | | |
| |||
0 commit comments