GNOME Bugzilla – Bug 533644
No argument checking in gtk.Action.set_tool_item_type()
Last modified: 2008-06-22 20:17:37 UTC
PyGTK runs this code without complaint: action = gtk.Action('name', 'action', 'tooltip', None) action.set_tool_item_type(None) It should raise either a TypeError or ValueError on action.set_tool_item_type(None). Your app will probably crash on action.create_tool_item() because None isn't a gtk.ToolItem subclass.
Created attachment 111101 [details] [review] extra check, fixing this Note that the patch is larger than it could be because I fixed indentation in that function along the way. In fact, only one if() is new.
Comment on attachment 111101 [details] [review] extra check, fixing this Looks good but could use a test.
Created attachment 113180 [details] [review] fix + unit test
Sending ChangeLog Sending gtk/gtk.override Sending tests/test_actiongroup.py Transmitting file data ... Committed revision 2997.