Skip to content

Commit 2ec9187

Browse files
hackaugustoadorilson
authored andcommitted
closes bpo-42726: gdb libpython: InstanceProxy support for py3 (pythonGH-23912)
On Fedora 31 gdb is using python 3.7.9, calling `proxyval` on an instance with a dictionary fails because of the `dict.iteritems` usage. This PR changes the code to be compatible with py2 and py3. This changed seemed small enough to not need an issue and news blurb, if one is required please let me know. Automerge-Triggered-By: GH:benjaminp
1 parent d443f26 commit 2ec9187

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fixed Python 3 compatibility issue with gdb/libpython.py handling of attribute
2+
dictionaries.

Tools/gdb/libpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def __init__(self, cl_name, attrdict, address):
468468
def __repr__(self):
469469
if isinstance(self.attrdict, dict):
470470
kwargs = ', '.join(["%s=%r" % (arg, val)
471-
for arg, val in self.attrdict.iteritems()])
471+
for arg, val in self.attrdict.items()])
472472
return '<%s(%s) at remote 0x%x>' % (self.cl_name,
473473
kwargs, self.address)
474474
else:

0 commit comments

Comments
 (0)