aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2017-10-17 03:03:44 +0000
committerJason Molenda <jmolenda@apple.com>2017-10-17 03:03:44 +0000
commit695a1f6e6cf7f164b71c5ee9f1756374547114c9 (patch)
tree9621ad0c8eb1af0a097801896bbc34dc7433bdba /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent45623bd06dfc763241b82be152d0d01d7bb5cf32 (diff)
downloadllvm-695a1f6e6cf7f164b71c5ee9f1756374547114c9.zip
llvm-695a1f6e6cf7f164b71c5ee9f1756374547114c9.tar.gz
llvm-695a1f6e6cf7f164b71c5ee9f1756374547114c9.tar.bz2
Committing this for Larry D'Anna:
This patch adds support for passing an arbitrary python stream (anything inheriting from IOBase) to SetOutputFileHandle or SetErrorFileHandle. Differential revision: https://reviews.llvm.org/D38829 <rdar://problem/34870417> llvm-svn: 315966
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 6c39690..246da4f 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -504,7 +504,7 @@ void ScriptInterpreterPython::LeaveSession() {
}
bool ScriptInterpreterPython::SetStdHandle(File &file, const char *py_name,
- PythonFile &save_file,
+ PythonObject &save_file,
const char *mode) {
if (file.IsValid()) {
// Flush the file before giving it to python to avoid interleaved output.
@@ -512,8 +512,7 @@ bool ScriptInterpreterPython::SetStdHandle(File &file, const char *py_name,
PythonDictionary &sys_module_dict = GetSysModuleDictionary();
- save_file = sys_module_dict.GetItemForKey(PythonString(py_name))
- .AsType<PythonFile>();
+ save_file = sys_module_dict.GetItemForKey(PythonString(py_name));
PythonFile new_file(file, mode);
sys_module_dict.SetItemForKey(PythonString(py_name), new_file);