Skip to content

Commit

Permalink
Make the benchmarking script's stdout and stderr line buffered.
Browse files Browse the repository at this point in the history
Reviewers: Craig Silverstein
  • Loading branch information
fergushenderson committed Aug 2, 2008
1 parent 1329c95 commit 4e88a96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bench/benchmark.py
Expand Up @@ -149,6 +149,16 @@ def show_help():
######################################################################
def main():
"""Run the benchmark per arguments"""

# Ensure that stdout and stderr are line buffered, rather than
# block buffered, as might be the default when running with
# stdout/stderr redirected to a file; this ensures that the
# output is prompt, even when the script takes a long time for
# a single step, and it also avoids confusing intermingling of
# stdout and stderr.
sys.stdout = os.fdopen(1, "w", 1)
sys.stderr = os.fdopen(2, "w", 1)

sum = Summary()
options, args = getopt(sys.argv[1:], 'a:c:n:f:',
['list-projects', 'actions=', 'help', 'compiler=',
Expand Down

0 comments on commit 4e88a96

Please sign in to comment.