mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54:21 +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
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue