summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2016-07-15 22:44:37 +0200
committerJonathan Slenders <jonathan@slenders.be>2016-07-15 22:45:17 +0200
commitedf8680191534468a800b51b9d3f81fcda1771ec (patch)
tree3c1630c4acf58900156f1753637cb6e25fade4c1
parent8d3d93336674a0f938e37abd3b92c7ca5e21711f (diff)
Assert stdout.isatty() in Vt100_Output.from_pty. If not, the error that we got is too hard to throubleshoot.
-rw-r--r--prompt_toolkit/terminal/vt100_output.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/prompt_toolkit/terminal/vt100_output.py b/prompt_toolkit/terminal/vt100_output.py
index 3b574f44..8b7833a7 100644
--- a/prompt_toolkit/terminal/vt100_output.py
+++ b/prompt_toolkit/terminal/vt100_output.py
@@ -355,6 +355,7 @@ class Vt100_Output(Output):
(This will take the dimensions by reading the pseudo
terminal attributes.)
"""
+ assert stdout.isatty()
def get_size():
rows, columns = _get_size(stdout.fileno())
return Size(rows=rows, columns=columns)