Windows cannot clean up tempdir if subfile still open

This commit is contained in:
Alan Hamlett 2017-05-21 17:09:27 -07:00
parent fac3db034f
commit f23b9cd9ef
1 changed files with 4 additions and 1 deletions

View File

@ -76,7 +76,10 @@ except ImportError:
return self.name
def __exit__(self, exc_type, exc_value, traceback):
shutil.rmtree(u(self.name))
try:
shutil.rmtree(u(self.name))
except:
pass
class NamedTemporaryFile(object):