]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314)
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>
Wed, 19 Apr 2023 05:05:52 +0000 (06:05 +0100)
committerGitHub <noreply@github.com>
Wed, 19 Apr 2023 05:05:52 +0000 (01:05 -0400)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Lib/idlelib/run.py
Misc/NEWS.d/next/Library/2023-04-06-16-55-51.gh-issue-102778.BWeAmE.rst [new file with mode: 0644]

index 577c49eb67b20d1f83095b3224d341cd88ad1656..04ce615621ee7cb05f820dfd4fc3401adef95695 100644 (file)
@@ -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 (file)
index 0000000..64ae5b5
--- /dev/null
@@ -0,0 +1 @@
+Support ``sys.last_exc`` in :mod:`idlelib`.