Re: Prepending to traceback

2005-02-09 Thread Ian Bicking
Stefan Behnel wrote: I want them to look like this: Traceback (most recent call last): ... File "/usr/lib/python2.4/site-packages/pyparsing.py", line 456, in parse loc,tokens = self.parseImpl( instring, loc, doActions ) File "/usr/lib/python2.4/site-packages/pyparsing.py", line 727, in pa

Re: Prepending to traceback

2005-02-02 Thread Larry Bates
Replace system exception hook with your on function that gets called when exception is raised (not fully tested): # # Define a function that is called when system exception happens # def excepthook(self, type, value, tb): # # This function allows the user to redefine what happens if the pro

Re: Prepending to traceback

2005-02-02 Thread Thomas Guettler
Am Wed, 02 Feb 2005 13:55:24 +0100 schrieb Stefan Behnel: > Hi! > > I'm writing a parser using pyparsing and I would like to augment the > ParserException tracebacks with information about the actual error line *in > the parsed text*. Pyparsing provides me with everything I need (parsed line >

Prepending to traceback

2005-02-02 Thread Stefan Behnel
Hi! I'm writing a parser using pyparsing and I would like to augment the ParserException tracebacks with information about the actual error line *in the parsed text*. Pyparsing provides me with everything I need (parsed line and column), but is there a way to push that information on the traceba