fix: avoid races in filesystem ops (#2287)

Use `exist_ok` and `missing_ok` in pathlib operations where we can.
This commit is contained in:
Lehman Garrison
2025-02-26 10:56:35 -05:00
committed by GitHub
parent 4d37797aa6
commit 88ef8dbd29
4 changed files with 4 additions and 8 deletions
+1 -2
View File
@@ -42,8 +42,7 @@ def main() -> None:
)
dest_path = Path("docs/data/how-it-works.png")
if dest_path.exists():
dest_path.unlink()
dest_path.unlink(missing_ok=True)
Path(screenshot).rename(dest_path)