]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/msw/wx.py
added stat.h include
[wxWidgets.git] / wxPython / src / msw / wx.py
index e5f773b4909db3ea4c6c3161734a2d8d5eddd47a..59779e933e2c977a628f2b516563c1ca8c42bcbc 100644 (file)
@@ -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: