mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Bug #1772489: make dir() work on traceback objects again.
This commit is contained in:
parent
ee634a4013
commit
3eed765223
2 changed files with 20 additions and 1 deletions
|
@ -283,6 +283,13 @@ class BuiltinTest(unittest.TestCase):
|
|||
f = Foo()
|
||||
self.assertRaises(TypeError, dir, f)
|
||||
|
||||
# dir(traceback)
|
||||
try:
|
||||
raise IndexError
|
||||
except:
|
||||
self.assertEqual(len(dir(sys.exc_info()[2])), 4)
|
||||
|
||||
|
||||
def test_divmod(self):
|
||||
self.assertEqual(divmod(12, 7), (1, 5))
|
||||
self.assertEqual(divmod(-12, 7), (-2, 2))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue