From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Wed, 19 Apr 2023 05:05:52 +0000 (+0100) Subject: gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314) X-Git-Tag: v3.12.0b1~507 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d1e4917e06d5638f1a7fa189d6d63ec9c2a27753;p=thirdparty%2FPython%2Fcpython.git gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314) --------- Co-authored-by: Terry Jan Reedy --- diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 577c49eb67b2..04ce615621ee 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 000000000000..64ae5b5b6d56 --- /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`.