File tree 4 files changed +4
-8
lines changed
4 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,7 @@ def main() -> None:
42
42
)
43
43
44
44
dest_path = Path ("docs/data/how-it-works.png" )
45
- if dest_path .exists ():
46
- dest_path .unlink ()
45
+ dest_path .unlink (missing_ok = True )
47
46
48
47
Path (screenshot ).rename (dest_path )
49
48
Original file line number Diff line number Diff line change @@ -399,8 +399,7 @@ def build_in_directory(args: CommandLineArguments) -> None:
399
399
400
400
output_dir = options .globals .output_dir
401
401
402
- if not output_dir .exists ():
403
- output_dir .mkdir (parents = True )
402
+ output_dir .mkdir (parents = True , exist_ok = True )
404
403
405
404
tmp_path = Path (mkdtemp (prefix = "cibw-run-" )).resolve (strict = True )
406
405
try :
Original file line number Diff line number Diff line change 25
25
def download (url : str , dest : Path ) -> None :
26
26
print (f"+ Download { url } to { dest } " )
27
27
dest_dir = dest .parent
28
- if not dest_dir .exists ():
29
- dest_dir .mkdir (parents = True )
28
+ dest_dir .mkdir (parents = True , exist_ok = True )
30
29
31
30
# we've had issues when relying on the host OS' CA certificates on Windows,
32
31
# so we use certifi (this sounds odd but requests also does this by default)
Original file line number Diff line number Diff line change 21
21
name = f"spam-0.1.0-py2-none-{platform}.whl"
22
22
dest = dest_dir / name
23
23
dest_dir.mkdir(parents=True, exist_ok=True)
24
- if dest.exists():
25
- dest.unlink()
24
+ dest.unlink(missing_ok=True)
26
25
shutil.copy(wheel, dest)
27
26
"""
28
27
You can’t perform that action at this time.
0 commit comments