How to profile exception handling in Python?

Viewed 241

Is there a way to find out how many exceptions are thrown (and caught) and maybe how much time exception handling took?

I'm using pyparsing (slightly modified) which relies heavily on exceptions and I want to find out (or at least estimate) if it would be worth the effort to rewrite it to work without exceptions.

Raising and catching of exceptions is widely scattered over the module so I'm searching a way which doesn't need to modify each try-except-block

1 Answers
Related