Attached is a patch that makes the embedded Python interpreter handle the 'exit' method correctly. I have applied the fix to the Python script embedded in ScriptInterpreterPython.cpp and embedded_interpreter.py, but I am not sure if anything actually uses the standalone version.<div>
<br></div><div>'exit' behaves like 'quit', which was already handled, and will close the stdout file handle if called. This would result in the following workflow generating an endless stream of exceptions:</div>
<div>(lldb) script</div><div>>>> exit()</div><div>(lldb) script</div><div><div><div>>>> Traceback (most recent call last):</div><div> File "embedded_interpreter.py", line 25, in interact</div>
<div> self.read_py_command()</div><div> File "embedded_interpreter.py", line 77, in read_py_command</div><div> line = self.my_raw_input(prompt)</div><div> File "embedded_interpreter.py", line 58, in my_raw_input</div>
<div> line = sys.stdin.readline()</div><div>ValueError: I/O operation on closed file</div><div>>>> Traceback (most recent call last):</div><div> File "embedded_interpreter.py", line 25, in interact</div>
<div> self.read_py_command()</div><div> File "embedded_interpreter.py", line 77, in read_py_command</div><div> line = self.my_raw_input(prompt)</div><div> File "embedded_interpreter.py", line 58, in my_raw_input</div>
<div> line = sys.stdin.readline()</div><div>ValueError: I/O operation on closed file</div></div></div>