Bug #1772489: make dir() work on traceback objects again.

This commit is contained in:
Collin Winter 2007-08-14 17:53:54 +00:00
parent ee634a4013
commit 3eed765223
2 changed files with 20 additions and 1 deletions

View file

@ -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))