From: David-Sarah Hopwood Date: Sun, 2 Dec 2012 01:54:47 +0000 (+0000) Subject: test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log... X-Git-Tag: allmydata-tahoe-1.10a1~35 X-Git-Url: https://git.rkrishnan.org/%5B/frontends/%22file:/%22doc.html/vdrive?a=commitdiff_plain;h=884685278b4d558b8eb38af2a1800948bc6d3aef;p=tahoe-lafs%2Ftahoe-lafs.git test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log entries on Windows. Signed-off-by: David-Sarah Hopwood --- diff --git a/src/allmydata/test/common_util.py b/src/allmydata/test/common_util.py index a3a190c0..e51ab8b0 100644 --- a/src/allmydata/test/common_util.py +++ b/src/allmydata/test/common_util.py @@ -45,8 +45,11 @@ class NonASCIIPathMixin: try: fileutil.rm_dir(dirpath) finally: - log.err("We were unable to delete a non-ASCII directory %r created by the test. " - "This is liable to cause failures on future builds." % (dirpath,)) + 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,)) + print msg + log.err(msg) self.addCleanup(_cleanup) os.mkdir(dirpath)