diff options
author | Enrico Granata <egranata@apple.com> | 2013-06-11 19:04:32 +0000 |
---|---|---|
committer | Enrico Granata <egranata@apple.com> | 2013-06-11 19:04:32 +0000 |
commit | 8d6e5ec29231b4003e09746ea08d19b853de36cf (patch) | |
tree | 3037737c1a112f966f17b7f3380da8378681fe3e /lldb/scripts/Python/python-wrapper.swig | |
parent | d45b9f15f91ec8463049df9b9d3f64045d0b8931 (diff) | |
download | bcm5719-llvm-8d6e5ec29231b4003e09746ea08d19b853de36cf.tar.gz bcm5719-llvm-8d6e5ec29231b4003e09746ea08d19b853de36cf.zip |
<rdar://problem/13759177>
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
Diffstat (limited to 'lldb/scripts/Python/python-wrapper.swig')
-rw-r--r-- | lldb/scripts/Python/python-wrapper.swig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/scripts/Python/python-wrapper.swig b/lldb/scripts/Python/python-wrapper.swig index 4723a9cce89..55a5910184c 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) |