Skip to content

Commit 8041d6f

Browse files
authored
Replace os.path.commonprefix() call with commonpath() (#280)
1 parent c6ee3eb commit 8041d6f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/manage/fsutils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ def rmtree(path, after_5s_warning=None, remove_ext_first=()):
153153
_rmdir(d, on_fail=to_warn.append, on_isfile=to_unlink)
154154

155155
if to_warn:
156-
f = os.path.commonprefix(to_warn)
156+
try:
157+
f = os.path.commonpath(to_warn)
158+
except ValueError:
159+
f = None
157160
if f:
158161
LOGGER.warn("Failed to remove %s", f)
159162
else:

0 commit comments

Comments
 (0)