From d1e4917e06d5638f1a7fa189d6d63ec9c2a27753 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Wed, 19 Apr 2023 06:05:52 +0100 Subject: gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314) --------- Co-authored-by: Terry Jan Reedy --- Lib/idlelib/run.py | 1 + Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst | 1 + 2 files changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 577c49e..04ce615 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -239,6 +239,7 @@ def print_exception(): efile = sys.stderr typ, val, tb = excinfo = sys.exc_info() sys.last_type, sys.last_value, sys.last_traceback = excinfo + sys.last_exc = val seen = set() def print_exc(typ, exc, tb): diff --git a/Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst b/Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst new file mode 100644 index 0000000..64ae5b5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst @@ -0,0 +1 @@ +Support ``sys.last_exc`` in :mod:`idlelib`. -- cgit v0.12