X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c7ad88ef818aa58d1c6fbd2bcb666d43ca4add8c..33b7017158309d0ffba37843f99bd7e53265dbc0:/wxPython/wx/py/introspect.py

diff --git a/wxPython/wx/py/introspect.py b/wxPython/wx/py/introspect.py
index a6df887ea2..ebb756999e 100644
--- a/wxPython/wx/py/introspect.py
+++ b/wxPython/wx/py/introspect.py
@@ -13,12 +13,6 @@ import sys
 import tokenize
 import types
 
-try:
-    True
-except NameError:
-    True = 1==1
-    False = 1==0
-
 def getAutoCompleteList(command='', locals=None, includeMagic=1, 
                         includeSingle=1, includeDouble=1):
     """Return list of auto-completion options for command.
@@ -61,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]!='_' \