GNOME Bugzilla – Bug 709926
"TypeError: 'NoneType' object is not iterable" when calling Widget.drag_dest_set_target_list or Widget.drag_source_set_target_list
Last modified: 2013-10-14 08:08:14 UTC
When calling Widget.drag_dest_set_target_list(None) or Widget.drag_source_set_target_list(None) a "TypeError: 'NoneType' object is not iterable" if thrown. According to Gtk documentation [1] [2], this shouldn't be the case since client code should be able to pass NULL in calls made to gtk_drag_dest_set_target_list and gtk_drag_source_set_target_list. [1] https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-dest-set-target-list [2] https://developer.gnome.org/gtk3/3.10/gtk3-Drag-and-Drop.html#gtk-drag-source-set-target-list
Created attachment 257026 [details] [review] Fix TypeError when setting drag target_list to None Attached patch changes the Widget overridden methods to check if the passed param is None and do not try to create a Gtk.TargetList if this is the case passing None to the 'introspected' method.
Thanks! Applied to master and 3-10 branch.