mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +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
|
@ -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):
|
||||
|
@ -629,6 +630,7 @@ class Executive:
|
|||
flist = self.rpchandler.get_remote_proxy(flist_oid)
|
||||
while tb and tb.tb_frame.f_globals["__name__"] in ["rpc", "run"]:
|
||||
tb = tb.tb_next
|
||||
sys.last_exc = val
|
||||
sys.last_type = typ
|
||||
sys.last_value = val
|
||||
item = stackviewer.StackTreeItem(flist, tb)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue