test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log entries on Windows.

Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
David-Sarah Hopwood 2012-12-02 01:54:47 +00:00
parent 73d5a059bd
commit 884685278b
1 changed files with 5 additions and 2 deletions

View File

@ -45,8 +45,11 @@ class NonASCIIPathMixin:
try: try:
fileutil.rm_dir(dirpath) fileutil.rm_dir(dirpath)
finally: finally:
log.err("We were unable to delete a non-ASCII directory %r created by the test. " if os.path.exists(dirpath):
msg = ("We were unable to delete a non-ASCII directory %r created by the test. "
"This is liable to cause failures on future builds." % (dirpath,)) "This is liable to cause failures on future builds." % (dirpath,))
print msg
log.err(msg)
self.addCleanup(_cleanup) self.addCleanup(_cleanup)
os.mkdir(dirpath) os.mkdir(dirpath)