Skip to content

Commit fa72100

Browse files
authored
fix: overwriting wheel on windows shouldn't break (#1464)
fix overwriting wheel on windows This is the same fix as #1129 but for Windows this time.
1 parent 7c9b837 commit fa72100

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cibuildwheel/windows.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import sys
88
import textwrap
99
from collections.abc import Set
10+
from contextlib import suppress
1011
from dataclasses import dataclass
1112
from functools import lru_cache
1213
from pathlib import Path
@@ -560,6 +561,9 @@ def build(options: Options, tmp_path: Path) -> None:
560561

561562
# we're all done here; move it to output (remove if already exists)
562563
if compatible_wheel is None:
564+
with suppress(FileNotFoundError):
565+
(build_options.output_dir / repaired_wheel.name).unlink()
566+
563567
shutil.move(str(repaired_wheel), build_options.output_dir)
564568
built_wheels.append(build_options.output_dir / repaired_wheel.name)
565569

0 commit comments

Comments
 (0)