X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ecc08ead918856a70559204f9b5daacc49385eaa..65fd49a43425e35a47e48987d4c9ad967a369734:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index cc7b8ce623..0e8da6d20e 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -637,7 +637,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: