[Python-checkins] closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912)

miss-islington webhook-mailer at python.org
Thu Dec 24 12:34:37 EST 2020


https://github.com/python/cpython/commit/efd64c8ea0fed1c13839cec0feea450820da34f8
commit: efd64c8ea0fed1c13839cec0feea450820da34f8
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2020-12-24T09:34:28-08:00
summary:

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 at gmail.com>

files:
A Misc/NEWS.d/next/Tools-Demos/2020-12-23-19-42-11.bpo-42726.a5EkTv.rst
M Tools/gdb/libpython.py

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 0000000000000..01a6e7fe55f5b
--- /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 ffb1813720e45..aa674f6be6019 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -468,7 +468,7 @@ def __init__(self, cl_name, attrdict, address):
     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:



More information about the Python-checkins mailing list