GNOME Bugzilla – Bug 749092
gdb pretty-printers fail on Python 3 with a TypeError: iter() returned non-iterator of type '_iterator'
Last modified: 2015-12-16 05:51:04 UTC
Created attachment 303060 [details] [review]
Fix Python 3 TypeError in gdb pretty-printers
Python 3 compatibility in bug 720635 was incomplete: iterators need to define __next__. This was fixed in gobject.py in 7991178a752a22274950e54dc4f05b55ae54d756, but glib.py also has two custom iterators.
Any chance we can get this one in? Would be really useful to put it into a stable release too as recent distros are not building gdb against Python 3.
Attachment 303060 [details] works for me. Existing installations can be patched with:
glib.GListPrinter._iterator.__next__ = glib.GListPrinter._iterator.next
glib.GHashPrinter._iterator.__next__ = glib.GHashPrinter._iterator.next
(cc'ing Alexander as he is the original committer)
The patch is still missing in glib2 2.46.2 and git master. It still works, can it be merged?
mclasen said it was fine to push this on IRC, so pushing it!
Author: Marius Gedminas <email@example.com>
Date: Fri May 8 02:54:00 2015 -0400
glib.py: Fix Python 3 TypeError in gdb pretty-printers