diff options
Diffstat (limited to 'contrib/llvm-project/lldb/source/Interpreter/embedded_interpreter.py')
-rw-r--r-- | contrib/llvm-project/lldb/source/Interpreter/embedded_interpreter.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/llvm-project/lldb/source/Interpreter/embedded_interpreter.py b/contrib/llvm-project/lldb/source/Interpreter/embedded_interpreter.py index 8a1195d83c6f..9312dbfaca4e 100644 --- a/contrib/llvm-project/lldb/source/Interpreter/embedded_interpreter.py +++ b/contrib/llvm-project/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): |