New GitHub issue #102832 from terryjreedy:<br>

<hr>

<pre>
#102778 deprecated sys.last_type/value/traceback in favor of sys.last_exc, added in 3.12.  We cannot access system system-set sys.last_exc in 3.10 and 3.11, but we can set it from sys.last_value or sys.exec_info()[1] and nearly never set or otherwise access the deprecated values.  The except is `sys.last_type, sys.last_value, sys.last_traceback = excinfo` in run.print_exception, which should remain as long as the REPL does the same (add comment).  Any `sys.last_exc = sys.last_value` statements can be deleted in June 2024. There is a [draft issue](https://github.com/orgs/python/projects/31/views/1?pane=issue&itemId=23303905) for this.

The files to be patched are run (where it handles exceptions or stackviewer), pyshell (where it starts stackviewer), stackviewer, and test_stackviewer.  [This diff](https://github.com/python/cpython/pull/102825/files) has the relevant locations.
</pre>

<hr>

<a href="https://github.com/python/cpython/issues/102832">View on GitHub</a>
<p>Labels: </p>
<p>Assignee: </p>