[New-bugs-announce] [issue45560] sys.last_* not set for SyntaxErrors with IDLE

Andre Roberge report at bugs.python.org
Thu Oct 21 17:31:52 EDT 2021


New submission from Andre Roberge <andre.roberge at gmail.com>:

As stated in the documentation, sys.last_type, sys.last_value and sys.last_traceback ... are set when an exception is not handled and the interpreter prints an error message and a stack traceback.

This is true whether the exception is a SyntaxError or some runtime error when a standard Python interpreter is used.

However, when the IDLE shell is used and a SyntaxError occurs, these are not set.  If it is not possible to change this behaviour in IDLE, perhaps the documentation of the sys module should be amended to include this information.

----------
assignee: terry.reedy
components: IDLE
messages: 404669
nosy: aroberge, terry.reedy
priority: normal
severity: normal
status: open
title: sys.last_* not set for SyntaxErrors with IDLE
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue45560>
_______________________________________


More information about the New-bugs-announce mailing list