Permalink
Browse files

helpers.log(): run sys.stdout.flush() first.

It's annoying when your log messages come out before stdout messages do.
But it's equally annoying (and inefficient) to have to flush every time you
print something.  This seems like a nice compromise.
  • Loading branch information...
1 parent c149e43 commit 3be291af938ad9eac6e89a4f0fb7036d3b283005 @apenwarr apenwarr committed Apr 1, 2010
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/bup/helpers.py
View
@@ -19,6 +19,7 @@ def _hard_write(fd, buf):
buf = buf[sz:]
def log(s):
+ sys.stdout.flush()
_hard_write(sys.stderr.fileno(), s)

0 comments on commit 3be291a

Please sign in to comment.