Skip to content

Commit f3bac77

Browse files
authored
Ignore clean-up errors for Windows temporary directory (#427)
Exploring a solution to #426 (comment)
1 parent 19262bb commit f3bac77

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpython-windows/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,10 @@ def build_cpython(
12351235
else:
12361236
raise ValueError("unhandled arch: %s" % arch)
12371237

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

12411244
with concurrent.futures.ThreadPoolExecutor(10) as e:

0 commit comments

Comments
 (0)