mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Issue #12333: close files before removing the directory
packaging.tests.support.TempdirManager: rmtree() fails on Windows if there are still open files in the directory.
This commit is contained in:
parent
3bcc0170bd
commit
0f270b2c37
1 changed files with 2 additions and 3 deletions
|
|
@ -126,13 +126,12 @@ class TempdirManager:
|
|||
self._files = []
|
||||
|
||||
def tearDown(self):
|
||||
os.chdir(self._olddir)
|
||||
shutil.rmtree(self._basetempdir)
|
||||
|
||||
for handle, name in self._files:
|
||||
handle.close()
|
||||
unlink(name)
|
||||
|
||||
os.chdir(self._olddir)
|
||||
shutil.rmtree(self._basetempdir)
|
||||
super(TempdirManager, self).tearDown()
|
||||
|
||||
def mktempfile(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue