Skip to content

Commit f626f60

Browse files
committed
"flush_output" option added to config
controls whether output will be flushed to stdout or not. committer: Bob Farrell <robertanthonyfarrell@gmail.com>
1 parent 26528b3 commit f626f60

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎CHANGELOG‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Menno sent me some patches to fix some stuff:
66

77
'self' in arg list is now highlighted a different colour.
88

9+
flush_output option added to config to control whether output is flushed to
10+
stdout or not on exit.
11+
912
v0.7.1
1013
======
1114
Added support for a history file, defaults to ~/.pythonhist and 100 lines but

‎bpython/cli.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def readlines(self, x):
110110
OPTS.arg_spec = True
111111
OPTS.hist_file = '~/.pythonhist'
112112
OPTS.hist_length = 100
113+
OPTS.flush_output = True
113114

114115
# TODO:
115116
#
@@ -1733,7 +1734,8 @@ def main():
17331734
sys.exit(1)
17341735

17351736
# Fake stdout data so everything's still visible after exiting
1736-
sys.stdout.write(o)
1737+
if OPTS.flush_output:
1738+
sys.stdout.write(o)
17371739
sys.stdout.flush()
17381740

17391741
if __name__ == '__main__':

0 commit comments

Comments
 (0)