mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-102799: use exception instance instead of sys.exc_info() (#102885)
This commit is contained in:
parent
c1e71ce56f
commit
44bd3fe570
7 changed files with 16 additions and 17 deletions
|
@ -173,8 +173,8 @@ else: #pragma: no cover
|
|||
"""Return the frame object for the caller's stack frame."""
|
||||
try:
|
||||
raise Exception
|
||||
except Exception:
|
||||
return sys.exc_info()[2].tb_frame.f_back
|
||||
except Exception as exc:
|
||||
return exc.__traceback__.tb_frame.f_back
|
||||
|
||||
#
|
||||
# _srcfile is used when walking the stack to check when we've got the first
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue