summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2020-12-24 09:37:07 -0800
committerGitHub <noreply@github.com>2020-12-24 09:37:07 -0800
commit3bb85672bb894403a787a9c5afc0ca5987d28fe0 (patch)
tree0d0b467d85563ce72017a6445a4085fd1d2edf48
parenta1251980d20ee8aab8d887fc0d30a726247327af (diff)
downloadcpython-git-3bb85672bb894403a787a9c5afc0ca5987d28fe0.tar.gz
closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-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 (cherry picked from commit b57ada98da0d5b0cf1ebc2c9c5502d04aa962042) Co-authored-by: Augusto Hack <hack.augusto@gmail.com>
-rw-r--r--Misc/NEWS.d/next/Tools-Demos/2020-12-23-19-42-11.bpo-42726.a5EkTv.rst2
-rwxr-xr-xTools/gdb/libpython.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Tools-Demos/2020-12-23-19-42-11.bpo-42726.a5EkTv.rst b/Misc/NEWS.d/next/Tools-Demos/2020-12-23-19-42-11.bpo-42726.a5EkTv.rst
new file mode 100644
index 0000000000..01a6e7fe55
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2020-12-23-19-42-11.bpo-42726.a5EkTv.rst
@@ -0,0 +1,2 @@
+Fixed Python 3 compatibility issue with gdb/libpython.py handling of attribute
+dictionaries.
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 33bf5ac821..aeaa63e540 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -468,7 +468,7 @@ class InstanceProxy(object):
def __repr__(self):
if isinstance(self.attrdict, dict):
kwargs = ', '.join(["%s=%r" % (arg, val)
- for arg, val in self.attrdict.iteritems()])
+ for arg, val in self.attrdict.items()])
return '<%s(%s) at remote 0x%x>' % (self.cl_name,
kwargs, self.address)
else: