From 884685278b4d558b8eb38af2a1800948bc6d3aef Mon Sep 17 00:00:00 2001 From: David-Sarah Hopwood Date: Sun, 2 Dec 2012 01:54:47 +0000 Subject: [PATCH] test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log entries on Windows. Signed-off-by: David-Sarah Hopwood --- src/allmydata/test/common_util.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) -- 2.45.2