X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b1e930a50d78b49c203f1c5e1e3172350b79586d..4f2570aaf16049c11fc50d85cb15952e73bbab85:/wxPython/src/msw/wx.py diff --git a/wxPython/src/msw/wx.py b/wxPython/src/msw/wx.py index e5f773b490..59779e933e 100644 --- a/wxPython/src/msw/wx.py +++ b/wxPython/src/msw/wx.py @@ -1499,7 +1499,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: