From b3cc11a08e1e9121ddba3b9afb9fae032e86f449 Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Sat, 18 Mar 2023 07:19:38 +0000 Subject: gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800) --- Lib/test/test_sys.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Lib/test/test_sys.py') diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index b839985def9..fb578c5ae6e 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1649,8 +1649,8 @@ class SizeofTest(unittest.TestCase): check(_ast.AST(), size('P')) try: raise TypeError - except TypeError: - tb = sys.exc_info()[2] + except TypeError as e: + tb = e.__traceback__ # traceback if tb is not None: check(tb, size('2P2i')) -- cgit v1.2.3