summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorLawrence D'Anna <lawrence_danna@apple.com>2019-10-17 01:35:22 +0000
committerLawrence D'Anna <lawrence_danna@apple.com>2019-10-17 01:35:22 +0000
commit0f783599a4c645d8ae826f990f7b938fac6e5dae (patch)
tree9792f137ff09b6b8b90cbcf3d75dd8a98999ea25 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent56ee31964f5a57621953eacdc8458bd41dfc4154 (diff)
downloadbcm5719-llvm-0f783599a4c645d8ae826f990f7b938fac6e5dae.tar.gz
bcm5719-llvm-0f783599a4c645d8ae826f990f7b938fac6e5dae.zip
delete SWIG typemaps for FILE*
Summary: The SWIG typemaps for FILE* are no longer used, so this patch deletes them. Reviewers: JDevlieghere, jasonmolenda, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D68963 llvm-svn: 375073
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index d773fd8d258..70654a42384 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -651,10 +651,15 @@ bool ScriptInterpreterPythonImpl::SetStdHandle(FileSP file_sp,
PythonDictionary &sys_module_dict = GetSysModuleDictionary();
+ auto new_file = PythonFile::FromFile(file, mode);
+ if (!new_file) {
+ llvm::consumeError(new_file.takeError());
+ return false;
+ }
+
save_file = sys_module_dict.GetItemForKey(PythonString(py_name));
- PythonFile new_file(file, mode);
- sys_module_dict.SetItemForKey(PythonString(py_name), new_file);
+ sys_module_dict.SetItemForKey(PythonString(py_name), new_file.get());
return true;
}
OpenPOWER on IntegriCloud