mirror of
https://github.com/python/cpython.git
synced 2025-10-10 00:43:41 +00:00
bpo-46411: Remove unnecessary calls to sys.exc_info() in tests (GH-30638)
This commit is contained in:
parent
c47c9e6589
commit
a287b31bcb
6 changed files with 14 additions and 16 deletions
|
@ -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([]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue