Skip to content

Commit 36ca3e9

Browse files
authored
Backport PR ipython#14684 on branch 8.x (Add sys.last_exc) (ipython#14685)
Backport PR ipython#14684: Add sys.last_exc
2 parents e81b38a + 4e89e2b commit 36ca3e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

IPython/core/interactiveshell.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,8 @@ def _get_exc_info(self, exc_tuple=None):
20932093
sys.last_type = etype
20942094
sys.last_value = value
20952095
sys.last_traceback = tb
2096+
if sys.version_info >= (3, 12):
2097+
sys.last_exc = value
20962098

20972099
return etype, value, tb
20982100

0 commit comments

Comments
 (0)