[3.12] gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339) (#105526)

gh-102832: IDLE - remove use of deprecated sys.last_xyzs for stackviewer (GH-103339)
(cherry picked from commit 3ee921d84f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2023-06-08 14:57:33 -07:00 committed by GitHub
parent b08ea9a561
commit f565fed548
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 51 deletions

View file

@ -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")