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