Terry J. Reedy <tjre...@udel.edu> added the comment:
This is most likely an oversight. It affects both normal and -n mode. The three sys attributes can be written. Given the error instance e caught in the IDLE process, we need to execute, *in the user namespace*, sys.last_type, sys.last_value, sys.traceback = type(e), e, None The syntax error handle should call run_source (or maybe run_code). I will make a PR if it seem to work. ---------- stage: -> test needed type: -> behavior versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45560> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com