From: Avery Pennarun Date: Thu, 1 Apr 2010 18:58:00 +0000 (-0400) Subject: helpers.log(): run sys.stdout.flush() first. X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3be291af938ad9eac6e89a4f0fb7036d3b283005;p=packages%2Fb%2Fbup.git 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. --- diff --git a/lib/bup/helpers.py b/lib/bup/helpers.py index d8d416f..6a98574 100644 --- a/lib/bup/helpers.py +++ b/lib/bup/helpers.py @@ -19,6 +19,7 @@ def _hard_write(fd, buf): buf = buf[sz:] def log(s): + sys.stdout.flush() _hard_write(sys.stderr.fileno(), s)