diff options
author | Tom de Vries <tdevries@suse.de> | 2024-03-09 16:13:10 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-03-09 16:13:10 +0100 |
commit | 50ede76876981364d6b1a314bb79c0412980c435 (patch) | |
tree | 211c94f7c5a738a18f43dccf9c31daa37ae599a5 /libbacktrace/allocfail.c | |
parent | b1abf8b1b93b5ccdcd400b925dd9046b80f0c32b (diff) | |
download | binutils-50ede76876981364d6b1a314bb79c0412980c435.zip binutils-50ede76876981364d6b1a314bb79c0412980c435.tar.gz binutils-50ede76876981364d6b1a314bb79c0412980c435.tar.bz2 |
[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>
Diffstat (limited to 'libbacktrace/allocfail.c')
0 files changed, 0 insertions, 0 deletions