call site 1 for code.Traceback.__getitem__
magic/testing/test_exprinfo.py - line 43
37
38
39
40
41
42
43
44
   def test_nested_scopes_2():
       a = 1
       def g():
           b = 2
           assert a == b
       excinfo = getexcinfo(AssertionError, g)
->     msg = getmsg(excinfo)
       assert msg == 'assert 1 == 2'
magic/exprinfo.py - line 442
435
436
437
438
439
440
441
442
443
444
445
446
447
   def getmsg(excinfo):
       if isinstance(excinfo, tuple):
           excinfo = py.code.ExceptionInfo(excinfo)
       #frame, line = gettbline(tb)
       #frame = py.code.Frame(frame)
       #return interpret(line, frame)
   
->     tb = excinfo.traceback[-1] 
       source = str(tb.statement).strip()
       x = interpret(source, tb.frame, should_fail=True)
       if not isinstance(x, str):
           raise TypeError, "interpret returned non-string %r" % (x,)
       return x