summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-01-18 07:33:00 (GMT)
committerGitHub <noreply@github.com>2022-01-18 07:33:00 (GMT)
commit42038d00ea7b0b5455e371285102d85006fbf687 (patch)
treeeafd13e52bb14e708e86140ffc7b725f4fcc908b /Lib/test/test_inspect.py
parent7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6 (diff)
downloadcpython-42038d00ea7b0b5455e371285102d85006fbf687.zip
cpython-42038d00ea7b0b5455e371285102d85006fbf687.tar.gz
cpython-42038d00ea7b0b5455e371285102d85006fbf687.tar.bz2
bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)
(cherry picked from commit a287b31bcb065e4122400cb59167340d25480e6d) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_inspect.py')
-rw-r--r--Lib/test/test_inspect.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py
index 93ff2f8..545dab5 100644
--- a/Lib/test/test_inspect.py
+++ b/Lib/test/test_inspect.py
@@ -132,8 +132,8 @@ class TestPredicates(IsTestBase):
self.istest(inspect.iscode, 'mod.spam.__code__')
try:
1/0
- except:
- tb = sys.exc_info()[2]
+ except Exception as e:
+ tb = e.__traceback__
self.istest(inspect.isframe, 'tb.tb_frame')
self.istest(inspect.istraceback, 'tb')
if hasattr(types, 'GetSetDescriptorType'):