|
30 | 30 | import os
|
31 | 31 | import platform
|
32 | 32 | import re
|
33 |
| -import shutil |
34 | 33 | import sys
|
35 | 34 | import winreg
|
36 | 35 | from collections.abc import MutableSequence
|
@@ -925,31 +924,24 @@ def key_reverse_mc(a):
|
925 | 924 | return MSVCCompiler.compile(self, sources, **kwargs)
|
926 | 925 |
|
927 | 926 | def spawn(self, cmd: MutableSequence[str]) -> None: # type: ignore[override] # More restrictive than supertype
|
928 |
| - is_link = cmd[0].endswith("link.exe") or cmd[0].endswith('"link.exe"') |
929 | 927 | is_mt = cmd[0].endswith("mt.exe") or cmd[0].endswith('"mt.exe"')
|
930 |
| - if is_mt: |
931 |
| - # We don't want mt.exe run... |
932 |
| - return |
| 928 | + assert not is_mt, ( |
| 929 | + "We don't want mt.exe run. We used to special case it," |
| 930 | + + " now just sanity check that this is unreachable" |
| 931 | + ) |
| 932 | + is_link = cmd[0].endswith("link.exe") or cmd[0].endswith('"link.exe"') |
933 | 933 | if is_link:
|
934 | 934 | # remove /MANIFESTFILE:... and add MANIFEST:NO
|
935 | 935 | for i in range(len(cmd)):
|
936 | 936 | if cmd[i].startswith(("/MANIFESTFILE:", "/MANIFEST:EMBED")):
|
937 | 937 | cmd[i] = "/MANIFEST:NO"
|
938 | 938 | break
|
939 |
| - if is_mt: |
940 |
| - # We want mt.exe run with the original manifest |
941 |
| - for i in range(len(cmd)): |
942 |
| - if cmd[i] == "-manifest": |
943 |
| - cmd[i + 1] += ".orig" |
944 |
| - break |
945 | 939 | super().spawn(cmd) # type: ignore[arg-type] # mypy variance issue, but pyright ok
|
946 | 940 | if is_link:
|
947 |
| - # We want a copy of the original manifest so we can use it later. |
948 |
| - for i in range(len(cmd)): |
949 |
| - if cmd[i].startswith("/MANIFESTFILE:"): |
950 |
| - mfname = cmd[i][14:] |
951 |
| - shutil.copyfile(mfname, mfname + ".orig") |
952 |
| - break |
| 941 | + assert not any(arg.startswith("/MANIFESTFILE:") for arg in cmd), ( |
| 942 | + "We used to copy the original manifest so we can use it later," |
| 943 | + + " now just sanity check that this is unreachable" |
| 944 | + ) |
953 | 945 |
|
954 | 946 | # CCompiler's implementations of these methods completely replace the values
|
955 | 947 | # determined by the build environment. This seems like a design that must
|
|
0 commit comments