X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3fbed81b2165fddbbf2ee7eddd6089b62db3692..65fd49a43425e35a47e48987d4c9ad967a369734:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 01c385eeb5..0e8da6d20e 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -579,7 +579,7 @@ NULL = None # For backwards compatibility only. You should really be wxColor = wxColour wxNamedColor = wxNamedColour - +wxPen = wxPyPen # backwards compatibility wxNoRefBitmap = wxBitmap @@ -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: