[Lldb-commits] [lldb] r161054 - /lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
Enrico Granata
egranata at apple.com
Tue Jul 31 09:58:13 PDT 2012
Author: enrico
Date: Tue Jul 31 11:58:12 2012
New Revision: 161054
URL: http://llvm.org/viewvc/llvm-project?rev=161054&view=rev
Log:
<rdar://problem/11862570> Fixing a potential crasher related to Python locking
Modified:
lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
Modified: lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp?rev=161054&r1=161053&r2=161054&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp (original)
+++ lldb/trunk/source/Interpreter/ScriptInterpreterPython.cpp Tue Jul 31 11:58:12 2012
@@ -367,7 +367,7 @@
StreamString run_string;
char error_str[1024];
const char *pty_slave_name = script_interpreter->m_embedded_python_pty.GetSlaveName (error_str, sizeof (error_str));
- if (pty_slave_name != NULL)
+ if (pty_slave_name != NULL && PyThreadState_GetDict() != NULL)
{
run_string.Printf ("run_one_line (%s, 'save_stderr = sys.stderr')", script_interpreter->m_dictionary_name.c_str());
PyRun_SimpleString (run_string.GetData());
@@ -474,7 +474,7 @@
StreamString run_string;
char error_str[1024];
const char *pty_slave_name = script_interpreter->m_embedded_python_pty.GetSlaveName (error_str, sizeof (error_str));
- if (pty_slave_name != NULL)
+ if (pty_slave_name != NULL && PyThreadState_GetDict() != NULL)
{
run_string.Printf ("run_one_line (%s, 'sys.stdin = save_stdin')", script_interpreter->m_dictionary_name.c_str());
PyRun_SimpleString (run_string.GetData());
More information about the lldb-commits
mailing list