bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)

This commit is contained in:
Irit Katriel 2022-01-18 07:05:16 +00:00 committed by GitHub
parent c47c9e6589
commit a287b31bcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 16 deletions

View file

@ -581,8 +581,8 @@ class BuiltinTest(unittest.TestCase):
# dir(traceback)
try:
raise IndexError
except:
self.assertEqual(len(dir(sys.exc_info()[2])), 4)
except IndexError as e:
self.assertEqual(len(dir(e.__traceback__)), 4)
# test that object has a __dir__()
self.assertEqual(sorted([].__dir__()), dir([]))