annotate a traceback

Robin Becker robin at reportlab.com
Thu Oct 29 11:16:30 EDT 2009


I want to annotate a traceback in routine A which is raised in B. Useful 
information in A is not available in B

I propose to use something like

def A(info):
     try:
         B()
     except:
         t,v,b=sys.exc_info()
         v.args = (' '.join(map(str,v.args))+', info=%r' % info,)
         raise

is this a reasonable approach?
-- 
Robin Becker




More information about the Python-list mailing list