<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, ...



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@183772 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/scripts/Python/python-wrapper.swig b/scripts/Python/python-wrapper.swig
index 4723a9c..55a5910 100644
--- a/scripts/Python/python-wrapper.swig
+++ b/scripts/Python/python-wrapper.swig
@@ -45,7 +45,13 @@
             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)