eliben/pyelftools — pull request #17 by ShaheedHaque (2013-12-27 17:48:46+00:00)
Title:     Use correct Python2/3 compatibility iterator.

Use an iterator which provides for Python2 and Python3 compatibility. All the unit tests pass, but I have not extended them to test this functionality. If required, a test like the following exercises the change:

$ git diff examples/dwarf_die_tree.py
diff --git a/examples/dwarf_die_tree.py b/examples/dwarf_die_tree.py
index 9dcb6b6..98851f4 100644
--- a/examples/dwarf_die_tree.py
+++ b/examples/dwarf_die_tree.py
@@ -62,7 +62,7 @@ def die_info_rec(die, indent_level=' '):
""" A recursive function for showing information about a DIE and its
children.
"""
- print(indent_level + 'DIE tag=%s' % die.tag)
+ print(indent_level + 'DIE=%s' % die)
child_indent = indent_level + ' '
for child in die.iter_children():
die_info_rec(child, child_indent)