From 2419f1d57cd20c3d8a0161f24700a47172a46b2f Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 13 Nov 2015 21:28:45 +0000 Subject: Modernize FormatBacktrace() and make portable for Python 3. llvm-svn: 253085 --- .../source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp index 73f9b8cae88..e3f84f53df0 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp @@ -825,6 +825,14 @@ PythonModule::AddModule(llvm::StringRef module) return PythonModule(PyRefType::Borrowed, PyImport_AddModule(str.c_str())); } + +PythonModule +PythonModule::ImportModule(llvm::StringRef module) +{ + std::string str = module.str(); + return PythonModule(PyRefType::Owned, PyImport_ImportModule(str.c_str())); +} + bool PythonModule::Check(PyObject *py_obj) { -- cgit v1.2.3