Skip to content

Commit 2b3fdbe

Browse files
tests(mm): another attempt to fix windows ci test issue
1 parent c086bdf commit 2b3fdbe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

invokeai/backend/util/util.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import re
55
import shutil
66
import stat
7+
import sys
78
import unicodedata
89
from pathlib import Path
910

@@ -91,4 +92,7 @@ def safe_rmtree(path: Path):
9192
9293
See: https://docs.python.org/3/library/shutil.html#rmtree-example
9394
"""
94-
shutil.rmtree(path, onexc=remove_readonly)
95+
if sys.version_info >= (3, 12):
96+
shutil.rmtree(str(path), onexc=remove_readonly)
97+
else:
98+
shutil.rmtree(str(path), onerror=remove_readonly)

0 commit comments

Comments
 (0)