summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp8
1 files changed, 8 insertions, 0 deletions
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)
{
OpenPOWER on IntegriCloud