]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
test/common_util.py: fix a bug in NonASCIIPathMixin that would cause spurious log...
authorDavid-Sarah Hopwood <david-sarah@jacaranda.org>
Sun, 2 Dec 2012 01:54:47 +0000 (01:54 +0000)
committerDavid-Sarah Hopwood <david-sarah@jacaranda.org>
Sun, 2 Dec 2012 01:54:47 +0000 (01:54 +0000)
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
src/allmydata/test/common_util.py

index a3a190c0dda94e3b0c379dac12c16da59b0e2681..e51ab8b001c0da1a8874f1293ff55827b89ac70f 100644 (file)
@@ -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)