X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c20da25748db95da19364dc118efcb9cc41bacc2..a57d56d66294799d6d36e64fa7aed6ff42a4d1e9:/wxPython/src/gtk/wx.py diff --git a/wxPython/src/gtk/wx.py b/wxPython/src/gtk/wx.py index 0b5ff9e492..622610f34a 100644 --- a/wxPython/src/gtk/wx.py +++ b/wxPython/src/gtk/wx.py @@ -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: