WIT runtime bug

I get a runtime bug if I use wx.lib.mixins.inspection.InspectionMixin in my program. My OS is Windows 7 SP1 (64 bit), my Python version is 3.3.2 (64 bit), Phoenix snapshot build used is win64-py3.3 r74041. The traceback I get after pressing Ctrl+Alt+i is this (oh yes, and I strictly followed Phoenix docs to implement WIT in my program):

Traceback (most recent call last):

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\lib\mixins\inspection.py”, line 156, in _OnKeyPress

self.ShowInspectionTool()

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\lib\mixins\inspection.py”, line 169, in ShowInspectionTool

InspectionTool().Show(wnd)

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\lib\inspection.py”, line 103, in Show

app=self._app)

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\lib\inspection.py”, line 159, in init

style=wx.NO_BORDER,

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\py\crust.py”, line 60, in init

rootIsNamespace=rootIsNamespace)

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\py\filling.py”, line 289, in init

static=static)

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\py\filling.py”, line 62, in init

self.SetItemHasChildren(self.root, self.objHasChildren(rootObject))

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\py\filling.py”, line 108, in objHasChildren

if self.objGetChildren(obj):

File “C:\Program Files\Python 3.3.2\lib\site-packages\wx\py\filling.py”, line 117, in objGetChildren

if otype is types.DictType \

AttributeError: ‘module’ object has no attribute ‘DictType’

Here’s a snippet of the source code used:

import wx

import wx.lib.mixins.inspection as wit

class MyApp(wx.App, wit.InspectionMixin):

def OnInit(self):

self.Init() # Initialize the Widget Inspection Tool (WIT)

return True

I press Ctrl+Alt+i when my program is running and I get the previously-posted traceback. Anyone knows what seems to be the issue?

I don't see this but then I am on:
Py2.7 on Win32 with r73946 Phoenix

According to the "Tags" the WIT is not yet ported to Py3, see if you find what the issue is and provide a patch to the dev list.

Werner

···

On 24/05/2013 23:52, Bo�tjan Mejak wrote:

Here's a snippet of the source code used:

import wx
import wx.lib.mixins.inspection as wit

class MyApp(wx.App, wit.InspectionMixin):

def OnInit(self):

self.Init() # Initialize the Widget Inspection Tool (WIT)

return True

I press Ctrl+Alt+i when my program is running and I get the previously-posted traceback. Anyone knows what seems to be the issue?

I fixed my patch. Thanks, Joaquin and Robin, for your wonderful suggestions. I also polished the patch a little bit, i.e. removed some imports that are not used in the code and some str() calls were fixed to six.string_types()… Anyway, if you see some other porting issue, let me know. :wink:

filling.patch (4.72 KB)

Thanks Boštjan,

  • I think you can replace:
if isinstance(obj, list) or isinstance(obj, tuple):

with

if isinstance(obj, (list, tuple)):

looks nicer to me :slight_smile:

J

···

On Tuesday, May 28, 2013 2:21:51 AM UTC+2, Boštjan Mejak wrote:

I fixed my patch. Thanks, Joaquin and Robin, for your wonderful suggestions. I also polished the patch a little bit, i.e. removed some imports that are not used in the code and some str() calls were fixed to six.string_types()… Anyway, if you see some other porting issue, let me know. :wink: