@@ -37,29 +37,29 @@ def apply_patches(errored):
3737 ["bash" , "./.evergreen/remove-unimplemented-tests.sh" ], # noqa: S607
3838 check = True ,
3939 )
40- try :
41- # Avoid shell=True by passing arguments as a list.
42- # Note: glob expansion doesn't work in shell=False, so we use a list of files.
43- spec_patch_dir = pathlib . Path ( "./.evergreen/spec- patch/" )
44- patches = [str (p ) for p in spec_patch_dir .glob ("*.patch" )]
45- patches += [ str ( p ) for p in ( spec_patch_dir / "permanent" ). glob ( "*.patch" )]
46- if patches :
47- for patch in patches :
48- print ( f"Applying patch { patch } " )
49- subprocess .run ( # noqa: S603
50- [ # noqa: S607
51- "git" ,
52- "apply" ,
53- "-R" ,
54- "--allow-empty" ,
55- "--whitespace=fix" ,
56- * patches ,
57- ],
58- check = True ,
59- stderr = subprocess .PIPE ,
60- )
61- except CalledProcessError as exc :
62- errored ["applying patches " ] = exc .stderr
40+ # Avoid shell=True by passing arguments as a list.
41+ # Note: glob expansion doesn't work in shell=False, so we use a list of files .
42+ spec_patch_dir = pathlib . Path ( "./.evergreen/spec-patch/" )
43+ patches = [ str ( p ) for p in spec_patch_dir . glob ( "*. patch" )]
44+ patches + = [str (p ) for p in ( spec_patch_dir / "permanent" ) .glob ("*.patch" )]
45+ if patches :
46+ for patch in patches :
47+ print ( f"Applying patch { patch } " )
48+ try :
49+ subprocess .run ( # noqa: S603
50+ [ # noqa: S607
51+ "git" ,
52+ "apply" ,
53+ "-R" ,
54+ "--allow-empty" ,
55+ "--whitespace=fix" ,
56+ str ( patch ) ,
57+ ],
58+ check = True ,
59+ stderr = subprocess .PIPE ,
60+ )
61+ except CalledProcessError as exc :
62+ errored [f" { patch } " ] = exc .stderr
6363
6464
6565def check_new_spec_directories (directory : pathlib .Path ) -> list [str ]:
0 commit comments