fix: avoid races in filesystem ops (#2287)
Use `exist_ok` and `missing_ok` in pathlib operations where we can.
This commit is contained in:
@@ -21,8 +21,7 @@ platform = wheel.stem.split("-")[-1]
|
||||
name = f"spam-0.1.0-py2-none-{platform}.whl"
|
||||
dest = dest_dir / name
|
||||
dest_dir.mkdir(parents=True, exist_ok=True)
|
||||
if dest.exists():
|
||||
dest.unlink()
|
||||
dest.unlink(missing_ok=True)
|
||||
shutil.copy(wheel, dest)
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user