Message401253
Given code like the following the try/except handling of Pdb (via `Cmd.onecmd`, see https://github.com/python/cpython/pull/4666) will mess with `sys.exc_info()`, which could be avoided:
```
try:
raise ValueError()
except Exception as exc:
e = exc
__import__('pdb').set_trace()
```
```
% ./python t_issue36550.py
--Return--
> …/t_issue36550.py(5)<module>()->None
-> __import__('pdb').set_trace()
(Pdb) import sys; sys.exc_info()
(<class 'AttributeError'>, AttributeError("'Pdb' object has no attribute 'do_import'"), <traceback object at 0x7f92d2782500>)
```
The initial / better motivation was described in the original issue: with pdb++/pdbpp I want to display tracebacks/errors with errors that might occur via Pdb's prompt, where this then showed up as interfering with it.
(Sorry for not responding on https://github.com/python/cpython/pull/4666 earlier, but I think it is only part of this issue, and therefore it should not get closed, and also creating a new one instead does not sound useful to me, so please consider to re-open it instead.) |
|
Date |
User |
Action |
Args |
2021-09-07 12:22:04 | blueyed | set | recipients:
+ blueyed, iritkatriel |
2021-09-07 12:22:04 | blueyed | set | messageid: <1631017324.88.0.543180250249.issue36550@roundup.psfhosted.org> |
2021-09-07 12:22:04 | blueyed | link | issue36550 messages |
2021-09-07 12:22:04 | blueyed | create | |
|