summaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/embedded_interpreter.py
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter/embedded_interpreter.py')
-rw-r--r--lldb/source/Interpreter/embedded_interpreter.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Interpreter/embedded_interpreter.py b/lldb/source/Interpreter/embedded_interpreter.py
index 8a1195d83c6f8..9312dbfaca4e1 100644
--- a/lldb/source/Interpreter/embedded_interpreter.py
+++ b/lldb/source/Interpreter/embedded_interpreter.py
@@ -73,7 +73,12 @@ def get_terminal_size(fd):
def readfunc_stdio(prompt):
sys.stdout.write(prompt)
sys.stdout.flush()
- return sys.stdin.readline().rstrip()
+ line = sys.stdin.readline()
+ # Readline always includes a trailing newline character unless the file
+ # ends with an incomplete line. An empty line indicates EOF.
+ if not line:
+ raise EOFError
+ return line.rstrip()
def run_python_interpreter(local_dict):