Skip to content

Commit a6339f3

Browse files
committed
Don't use curses interface when stdout is not attached to a terminal.
1 parent 93954fa commit a6339f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bpython/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ def main(args=None, locals_=None):
15821582
print '(C) 2008-2009 Bob Farrell et al. See AUTHORS for detail.'
15831583
return
15841584

1585-
if not os.isatty(sys.stdin.fileno()):
1585+
if not (sys.stdin.isatty() and sys.stdout.isatty()):
15861586
interpreter = code.InteractiveInterpreter()
15871587
interpreter.runsource(sys.stdin.read())
15881588
return

0 commit comments

Comments
 (0)