diff options
author | Zachary Turner <zturner@google.com> | 2015-11-13 21:28:45 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2015-11-13 21:28:45 +0000 |
commit | 2419f1d57cd20c3d8a0161f24700a47172a46b2f (patch) | |
tree | a316d8d2f1a3d9b003c256f480a24f6d89046612 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
parent | 75b4be9a1198c53384980eadca2708628b97622c (diff) | |
download | bcm5719-llvm-2419f1d57cd20c3d8a0161f24700a47172a46b2f.tar.gz bcm5719-llvm-2419f1d57cd20c3d8a0161f24700a47172a46b2f.zip |
Modernize FormatBacktrace() and make portable for Python 3.
llvm-svn: 253085
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | 8 |
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) { |