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 00000000000..9c1aa576258 --- /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 c003c1ab4a2..6453dff95df 100755 --- a/Tools/gdb/libpython.py +++ b/Tools/gdb/libpython.py @@ -2108,6 +2108,7 @@ def invoke(self, args, from_tty): while True: if not pyop_frame: print(UNABLE_READ_INFO_PYTHON_FRAME) + break if pyop_frame.is_shim(): break