mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-102778: Add sys.last_exc, deprecate sys.last_type, sys.last_value,sys.last_traceback (#102779)
This commit is contained in:
parent
039714d00f
commit
e1e9bab006
22 changed files with 103 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue