[py-svn] py-trunk commit 1c31b7e6dde2: by default flush log writes to files

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Nov 24 14:47:14 CET 2009


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview/
# User holger krekel <holger at merlinux.eu>
# Date 1259059693 28800
# Node ID 1c31b7e6dde204243118244ee1f108912d37cb12
# Parent 77705f6e09a75cd3199390d3bb3f0000d1560ddb
by default flush log writes to files

--- a/py/impl/log/log.py
+++ b/py/impl/log/log.py
@@ -132,6 +132,8 @@ class File(object):
     def __call__(self, msg): 
         """ write a message to the log """
         self._file.write(str(msg) + "\n")
+        if hasattr(self._file, 'flush'):
+            self._file.flush()
 
 class Path(object): 
     """ log consumer that opens and writes to a Path """



More information about the pytest-commit mailing list