]> granicus.if.org Git - python/commitdiff
test_logging: fixed bug in failure diagnostics.
authorVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 13 May 2011 13:45:08 +0000 (14:45 +0100)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>
Fri, 13 May 2011 13:45:08 +0000 (14:45 +0100)
Lib/test/test_logging.py

index 505ce6e3b66df546e6eb068b03141dfd9f9740c3..f215834c62895fad749576dcc3b367e8753361fa 100644 (file)
@@ -3526,8 +3526,8 @@ class TimedRotatingFileHandlerTest(BaseFileTest):
         msg = 'No rotated files found, went back %d seconds' % GO_BACK
         if not found:
             #print additional diagnostics
-            dn = os.path.dirname(self.fn)
-            files = [f for f in os.listdir(dn) if f.startswith(self.fn)]
+            dn, fn = os.path.split(self.fn)
+            files = [f for f in os.listdir(dn) if f.startswith(fn)]
             print('Test time: %s' % now.strftime("%Y-%m-%d %H-%M-%S"))
             print('The only matching files are: %s' % files)
         self.assertTrue(found, msg=msg)