summaryrefslogtreecommitdiffstats
path: root/Lib/test/inspect_fodder.py
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-03-31 10:23:02 (GMT)
committerGitHub <noreply@github.com>2023-03-31 10:23:02 (GMT)
commit44bd3fe570da9115bec67694404b8da26716a1d7 (patch)
treef6280db95a581e4363bc6c2dfde592b932f3cd07 /Lib/test/inspect_fodder.py
parentc1e71ce56fdb3eab62ad3190d09130f800e54610 (diff)
downloadcpython-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/test/inspect_fodder.py')
-rw-r--r--Lib/test/inspect_fodder.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/inspect_fodder.py b/Lib/test/inspect_fodder.py
index e1287a3..567dfba 100644
--- a/Lib/test/inspect_fodder.py
+++ b/Lib/test/inspect_fodder.py
@@ -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):