summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/pyshell.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-08 20:48:10 (GMT)
committerGitHub <noreply@github.com>2023-06-08 20:48:10 (GMT)
commitc2df09fb4d152fd0748790af38668841e4faca93 (patch)
treed6b1dd5c914df5caf67d18e8ee64ee98863b2854 /Lib/idlelib/pyshell.py
parentb073b30cae0deb36b01363346d9b128930ef0f35 (diff)
downloadcpython-c2df09fb4d152fd0748790af38668841e4faca93.zip
cpython-c2df09fb4d152fd0748790af38668841e4faca93.tar.gz
cpython-c2df09fb4d152fd0748790af38668841e4faca93.tar.bz2
[3.11] gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (#105527)
gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (cherry picked from commit 3ee921d84f06da9dfa8aa29e0d33778b9dbf8f23) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Lib/idlelib/pyshell.py')
-rwxr-xr-xLib/idlelib/pyshell.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
index bdde156..3141b47 100755
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1363,19 +1363,19 @@ class PyShell(OutputWindow):
self.text.tag_remove(self.user_input_insert_tags, index_before)
self.shell_sidebar.update_sidebar()
- def open_stack_viewer(self, event=None):
+ def open_stack_viewer(self, event=None): # -n mode only
if self.interp.rpcclt:
return self.interp.remote_stack_viewer()
+
+ from idlelib.stackviewer import StackBrowser
try:
- sys.last_traceback
+ StackBrowser(self.root, sys.last_value, self.flist)
except:
messagebox.showerror("No stack trace",
"There is no stack trace yet.\n"
- "(sys.last_traceback is not defined)",
+ "(sys.last_value is not defined)",
parent=self.text)
- return
- from idlelib.stackviewer import StackBrowser
- StackBrowser(self.root, self.flist)
+ return None
def view_restart_mark(self, event=None):
self.text.see("iomark")