From 8d6e5ec29231b4003e09746ea08d19b853de36cf Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 11 Jun 2013 19:04:32 +0000 Subject: Allowing LLDB to resolve names of Python functions when they are located in classes This allows things like *bound* classmethods to be used for formatters, commands, ... llvm-svn: 183772 --- lldb/scripts/Python/python-wrapper.swig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lldb/scripts/Python/python-wrapper.swig') diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 4723a9c..55a59101 100644 --- a/lldb/scripts/Python/python-wrapper.swig +++ b/lldb/scripts/Python/python-wrapper.swig @@ -45,7 +45,13 @@ ResolvePythonName(const char* name, return NULL; } - if (!PyDict_Check(pmodule)) + if (PyType_Check(pmodule)) + { + main_dict = ((PyTypeObject*)pmodule)->tp_dict; + if (!main_dict) + return NULL; + } + else if (!PyDict_Check(pmodule)) { main_dict = PyModule_GetDict (pmodule); if (!main_dict) -- cgit v1.1