]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/gtk/wx.py
More fixes for wxPopupWindow.
[wxWidgets.git] / wxPython / src / gtk / wx.py
index 0b5ff9e49203eb8c6009637a372df02cd99beddc..622610f34a584d4b88c23d06dba8b7e43a02fced 100644 (file)
@@ -1493,7 +1493,8 @@ def wxPyTypeCast(obj, typeStr):
     theClass = globals()[typeStr+"Ptr"]
     typeStr = __wxPyPtrTypeMap.get(typeStr, typeStr)
     if hasattr(obj, "this"):
-        if obj.__class__ is theClass:   # if already the right type then just return it
+        # if already the right type then just return it
+        if isinstance(obj, theClass) or obj.__class__ is theClass:
             return obj
         newPtr = ptrcast(obj.this, typeStr+"_p")
     else: