summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-08-10 21:26:55 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-08-10 21:26:55 +0000
commit705c3b6aaa716b2df8ffc6735fe41c7a1d07c1f2 (patch)
tree4753866dc9d7ae32961c6f28824da7ed8768c734 /lldb/source/Interpreter/ScriptInterpreterPython.cpp
parent57f3db6e2e419628bed1ed6cfee08ac4a517d0f6 (diff)
downloadbcm5719-llvm-705c3b6aaa716b2df8ffc6735fe41c7a1d07c1f2.tar.gz
bcm5719-llvm-705c3b6aaa716b2df8ffc6735fe41c7a1d07c1f2.zip
There is no need to restore (sys.stdin, sys.stdout) of the python script
interpreter right before calling Py_Finalize(). This also fixed the crash as reported in rdar://problem/8252903. llvm-svn: 110731
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 3d0dafa2545..5006c9df8cf 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -211,15 +211,12 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete
PyRun_SimpleString ("from embedded_interpreter import run_python_interpreter");
PyRun_SimpleString ("import sys");
PyRun_SimpleString ("from termios import *");
- PyRun_SimpleString ("old_stdin = sys.stdin");
StreamString run_string;
run_string.Printf ("new_stdin = open('%s', 'r')", pty_slave_name);
PyRun_SimpleString (run_string.GetData());
PyRun_SimpleString ("sys.stdin = new_stdin");
- PyRun_SimpleString ("old_stdout = sys.stdout");
-
if (out_fh != NULL)
{
PyObject *new_sysout = PyFile_FromFile (out_fh, (char *) "", (char *) "w",
@@ -253,8 +250,6 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete
ScriptInterpreterPython::~ScriptInterpreterPython ()
{
- PyRun_SimpleString ("sys.stdin = old_stdin");
- PyRun_SimpleString ("sys.stdout = old_stdout");
Py_Finalize ();
}
OpenPOWER on IntegriCloud