]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed introspection of objects with attrs without string names.
authorRobin Dunn <robin@alldunn.com>
Mon, 26 Apr 2004 23:38:06 +0000 (23:38 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 26 Apr 2004 23:38:06 +0000 (23:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/wx/py/introspect.py

index e948296ed8c49d355aab02045fdfb98e9202beba..ebb756999e44a1fb36ec01f614cc318edff8aaa2 100644 (file)
@@ -55,6 +55,10 @@ def getAttributeNames(object, includeMagic=1, includeSingle=1,
     for item in attributes:
         dict[item] = None
     attributes = dict.keys()
+    # new-style swig wrappings can result in non-string attributes
+    # e.g. ITK http://www.itk.org/
+    attributes = [attribute for attribute in attributes \
+                  if type(attribute) == str]
     attributes.sort(lambda x, y: cmp(x.upper(), y.upper()))
     if not includeSingle:
         attributes = filter(lambda item: item[0]!='_' \