Index: lldb/source/Interpreter/embedded_interpreter.py =================================================================== --- lldb/source/Interpreter/embedded_interpreter.py +++ lldb/source/Interpreter/embedded_interpreter.py @@ -73,7 +73,10 @@ def readfunc_stdio(prompt): sys.stdout.write(prompt) sys.stdout.flush() - return sys.stdin.readline().rstrip() + line = sys.stdin.readline() + if not line: + raise EOFError + return line.rstrip() def run_python_interpreter(local_dict): Index: lldb/test/Shell/ScriptInterpreter/Python/eof.test =================================================================== --- /dev/null +++ lldb/test/Shell/ScriptInterpreter/Python/eof.test @@ -0,0 +1,4 @@ +RUN: echo 'foo' | %lldb -o script | FileCheck %s + +CHECK: >>> +CHECK-NOT: >>>