Try to fix test.test_support.rmtree() on Windows for fixing issue28847 tests.

This commit is contained in:
Serhiy Storchaka 2016-12-03 07:57:54 +02:00
parent 1d2cfe263c
commit 7653c3806c
1 changed files with 2 additions and 2 deletions

View File

@ -239,9 +239,9 @@ if sys.platform.startswith("win"):
fullname = os.path.join(path, name) fullname = os.path.join(path, name)
if os.path.isdir(fullname): if os.path.isdir(fullname):
_waitfor(_rmtree_inner, fullname, waitall=True) _waitfor(_rmtree_inner, fullname, waitall=True)
_force_run(path, os.rmdir, fullname) _force_run(fullname, os.rmdir, fullname)
else: else:
_force_run(path, os.unlink, fullname) _force_run(fullname, os.unlink, fullname)
_waitfor(_rmtree_inner, path, waitall=True) _waitfor(_rmtree_inner, path, waitall=True)
_waitfor(lambda p: _force_run(p, os.rmdir, p), path) _waitfor(lambda p: _force_run(p, os.rmdir, p), path)
else: else: