Files
binutils-gdb/gdb/python
Tom de Vries 50ede76876 [gdb/python] Normalize exceptions in gdbpy_err_fetch
With python 3.12, I run into:
...
(gdb) PASS: gdb.python/py-block.exp: check variable access
python print (block['nonexistent'])^M
Python Exception <class 'KeyError'>: 'nonexistent'^M
Error occurred in Python: 'nonexistent'^M
(gdb) FAIL: gdb.python/py-block.exp: check nonexistent variable
...

The problem is that that PyErr_Fetch returns a normalized exception, while the
test-case matches the output for an unnormalized exception.

With python 3.6, PyErr_Fetch returns an unnormalized exception, and the
test passes.

Fix this by:
- updating the test-case to match the output for a normalized exception, and
- lazily forcing normalized exceptions using PyErr_NormalizeException.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2024-03-09 16:13:10 +01:00
..
2024-03-08 10:50:13 -07:00
2024-02-28 09:08:16 -07:00
2024-02-01 07:10:57 -07:00
2024-02-27 10:30:29 -07:00