Issue #28666: Fix removing readonly directories on Windows.

This commit is contained in:
Serhiy Storchaka 2016-11-20 20:04:54 +02:00
parent 2ccb98800a
commit bbfe6c3986

View file

@ -363,7 +363,7 @@ def _rmtree_inner(path):
else:
_force_run(path, os.unlink, fullname)
_waitfor(_rmtree_inner, path, waitall=True)
_waitfor(os.rmdir, path)
_waitfor(lambda p: _force_run(p, os.rmdir, p), path)
else:
_unlink = os.unlink
_rmdir = os.rmdir