[IronPython] Getting a traceback stack in IronPython 2.0

Laurion Burchall laurionb at service.exchange.microsoft.com
Wed Jan 14 04:43:07 CET 2009


I'm upgrading our internal test framework from IronPython 1.X to 2.X. Getting a good stack trace from an exception is eluding me. The old code looks like this:

   try:
    # runs the test
   except Exception, e:
    failCount += 1
    PrintTestOutcome(testCount, False, testFullName, e.ToString())
What is the 2.X equivalent? By default e.ToString() gives the ugly 'real' callstack. In a test program e.clsException did the right thing, but that only appears sometimg (if System is imported?) and when used in the test framework gave the .NET callstack instead of line number in Python scripts.

Any suggestions?

thanks,
--Laurion


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20090114/18ad7373/attachment.html>


More information about the Ironpython-users mailing list