From fc76eb217a43d9813234fc2b540cf0c6d03a08c6 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Sat, 8 Apr 2023 12:41:24 -0500 Subject: [PATCH] fix overwriting wheel on windows This is the same fix as #1129 but for Windows this time. --- cibuildwheel/windows.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index e0f16d815..aadc97f1e 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -560,6 +560,11 @@ def build(options: Options, tmp_path: Path) -> None: # we're all done here; move it to output (remove if already exists) if compatible_wheel is None: + try: + (build_options.output_dir / repaired_wheel.name).unlink() + except FileNotFoundError: + pass + shutil.move(str(repaired_wheel), build_options.output_dir) built_wheels.append(build_options.output_dir / repaired_wheel.name)