Skip to content

Commit

Permalink
Ignore clean-up errors for Windows temporary directory
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Dec 18, 2024
1 parent f91adf9 commit c6ddee6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,7 +1235,10 @@ def build_cpython(
else:
raise ValueError("unhandled arch: %s" % arch)

with tempfile.TemporaryDirectory(prefix="python-build-") as td:
tempdir_opts = (
{"ignore_cleanup_errors": True} if sys.version_info >= (3, 12) else {}
)
with tempfile.TemporaryDirectory(prefix="python-build-", **tempdir_opts) as td:
td = pathlib.Path(td)

with concurrent.futures.ThreadPoolExecutor(10) as e:
Expand Down

0 comments on commit c6ddee6

Please sign in to comment.