diff options
author | Lars Wirzenius <liw@liw.fi> | 2012-05-09 22:30:26 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2012-05-09 22:30:26 +0100 |
commit | 833c7731401dd6f64b01a51e48e1042183a5749c (patch) | |
tree | 0f7d87c1bfff48157864f87df2ef50d3b84fef3d | |
parent | fc63f058a0cb989f16420c0ad00336cc449626a1 (diff) | |
download | seivot-833c7731401dd6f64b01a51e48e1042183a5749c.tar.gz |
Only remove temporary directory if it (still) exists
-rwxr-xr-x | seivot | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -523,8 +523,9 @@ class Seivot(cliapp.Application): self.report.add_measurement(func.__name__, nth_gen, measurement) def cleanup(self): - logging.info('Removing temporary directory %s' % self.tempdir) - shutil.rmtree(self.tempdir) + if os.path.exists(self.tempdir): + logging.info('Removing temporary directory %s' % self.tempdir) + shutil.rmtree(self.tempdir) def disk_usage(self, pathname): '''Simulate du(1). Return disk usage in bytes.''' |