summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/pyshell.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-03-18 11:47:11 (GMT)
committerGitHub <noreply@github.com>2023-03-18 11:47:11 (GMT)
commite1e9bab0061e8d4bd7b94ed455f3bb7bf8633ae7 (patch)
tree8363c72cc70b34e06fed5c39d86ec99047613799 /Lib/idlelib/pyshell.py
parent039714d00f147be4d018fa6aeaf174aad7e8fa32 (diff)
downloadcpython-e1e9bab0061e8d4bd7b94ed455f3bb7bf8633ae7.zip
cpython-e1e9bab0061e8d4bd7b94ed455f3bb7bf8633ae7.tar.gz
cpython-e1e9bab0061e8d4bd7b94ed455f3bb7bf8633ae7.tar.bz2
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779)
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-xLib/idlelib/pyshell.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index e68233a..edc77ff 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1367,11 +1367,14 @@ class PyShell(OutputWindow):
if self.interp.rpcclt:
return self.interp.remote_stack_viewer()
try:
- sys.last_traceback
+ if hasattr(sys, 'last_exc'):
+ sys.last_exc.__traceback__
+ else:
+ sys.last_traceback
except:
messagebox.showerror("No stack trace",
"There is no stack trace yet.\n"
- "(sys.last_traceback is not defined)",
+ "(sys.last_exc and sys.last_traceback are not defined)",
parent=self.text)
return
from idlelib.stackviewer import StackBrowser