summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst1
-rwxr-xr-xTools/gdb/libpython.py1
2 files changed, 2 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst b/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst
new file mode 100644
index 0000000..9c1aa57
--- /dev/null
+++ b/Misc/NEWS.d/next/Tools-Demos/2022-12-29-19-22-11.bpo-45256.a0ee_H.rst
@@ -0,0 +1 @@
+Fix a bug that caused an :exc:`AttributeError` to be raised in ``python-gdb.py`` when ``py-locals`` is used without a frame.
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index 857e52f..a99ce94 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -2126,6 +2126,7 @@ class PyLocals(gdb.Command):
while True:
if not pyop_frame:
print(UNABLE_READ_INFO_PYTHON_FRAME)
+ break
sys.stdout.write('Locals for %s\n' % (pyop_frame.co_name.proxyval(set())))