diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-03-31 10:23:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-31 10:23:02 (GMT) |
commit | 44bd3fe570da9115bec67694404b8da26716a1d7 (patch) | |
tree | f6280db95a581e4363bc6c2dfde592b932f3cd07 /Lib/logging | |
parent | c1e71ce56fdb3eab62ad3190d09130f800e54610 (diff) | |
download | cpython-44bd3fe570da9115bec67694404b8da26716a1d7.zip cpython-44bd3fe570da9115bec67694404b8da26716a1d7.tar.gz cpython-44bd3fe570da9115bec67694404b8da26716a1d7.tar.bz2 |
gh-102799: use exception instance instead of sys.exc_info() (#102885)
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 9241d73..056380f 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -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 |