Kaydet (Commit) 0f270b2c authored tarafından Victor Stinner's avatar Victor Stinner

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.
üst 3bcc0170
......@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment