@@ -925,31 +925,24 @@ def key_reverse_mc(a):
925
925
return MSVCCompiler .compile (self , sources , ** kwargs )
926
926
927
927
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
928
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
929
+ assert not is_mt , (
930
+ "We don't want mt.exe run. We used to special case it,"
931
+ + " now just sanity check that this is unreachable"
932
+ )
933
+ is_link = cmd [0 ].endswith ("link.exe" ) or cmd [0 ].endswith ('"link.exe"' )
933
934
if is_link :
934
935
# remove /MANIFESTFILE:... and add MANIFEST:NO
935
936
for i in range (len (cmd )):
936
937
if cmd [i ].startswith (("/MANIFESTFILE:" , "/MANIFEST:EMBED" )):
937
938
cmd [i ] = "/MANIFEST:NO"
938
939
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
940
super ().spawn (cmd ) # type: ignore[arg-type] # mypy variance issue, but pyright ok
946
941
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
942
+ assert not any (arg .startswith ("/MANIFESTFILE:" ) for arg in cmd ), (
943
+ "We used to copy the original manifest so we can use it later,"
944
+ + " now just sanity check that this is unreachable"
945
+ )
953
946
954
947
# CCompiler's implementations of these methods completely replace the values
955
948
# determined by the build environment. This seems like a design that must
0 commit comments