From 695a1f6e6cf7f164b71c5ee9f1756374547114c9 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 17 Oct 2017 03:03:44 +0000 Subject: 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 llvm-svn: 315966 --- .../Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 6c39690268c6..246da4f07b83 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(); + save_file = sys_module_dict.GetItemForKey(PythonString(py_name)); PythonFile new_file(file, mode); sys_module_dict.SetItemForKey(PythonString(py_name), new_file); -- cgit v1.2.3