1 # SPDX-License-Identifier: MIT
3 # Copyright The SCons Foundation
6 Phony tool to modify a file in place for testing SCons.
8 Drops lines that match a pattern. Currently used to test
9 ranlib and ar behavior without actually invoking those tools.
15 line
= ('/*' + sys
.argv
[1] + '*/\n').encode('utf-8')
16 with
open(sys
.argv
[2], 'rb') as ifp
:
17 lines
= [ln
for ln
in ifp
if ln
!= line
]
18 with
open(sys
.argv
[2], 'wb') as ofp
:
22 if __name__
== '__main__':