gh-102799: use exception instance instead of sys.exc_info() (#102885)

This commit is contained in:
Irit Katriel 2023-03-31 11:23:02 +01:00 committed by GitHub
parent c1e71ce56f
commit 44bd3fe570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 17 deletions

View file

@ -1,7 +1,7 @@
# line 1
'A module docstring.'
import sys, inspect
import inspect
# line 5
# line 7
@ -41,8 +41,8 @@ class StupidGit:
def argue(self, a, b, c):
try:
spam(a, b, c)
except:
self.ex = sys.exc_info()
except BaseException as e:
self.ex = e
self.tr = inspect.trace()
@property
@ -78,8 +78,8 @@ async def lobbest(grenade):
currentframe = inspect.currentframe()
try:
raise Exception()
except:
tb = sys.exc_info()[2]
except BaseException as e:
tb = e.__traceback__
class Callable:
def __call__(self, *args):