diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-01-18 07:33:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-18 07:33:00 (GMT) |
commit | 42038d00ea7b0b5455e371285102d85006fbf687 (patch) | |
tree | eafd13e52bb14e708e86140ffc7b725f4fcc908b /Lib/test/test_inspect.py | |
parent | 7a822c92782ffda8fa32a4b30a95b9de7cc1b8e6 (diff) | |
download | cpython-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.py | 4 |
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'): |