Re: Question on try/except

2006-08-07 Thread Patrick Maupin
Kirk McDonald wrote: > Dan wrote: > > Is there some particular use in catching an exception and immediately > > re-raising it? Why catch it at all? > > All I can think of is that it changes the traceback to point to the > re-raise and not the original raise. I've used this technique before. It

Re: Question on try/except

2006-08-07 Thread Kirk McDonald
Dan wrote: > While perusing sre.py in the standard library, I came upon this snippet > of code in the _compile() function definition: > > try: > p = sre_compile.compile(pattern, flags) > except error, v: > raise error, v # invalid expression > > Is there some particular u