Re: catching syntax errors via excepthook?

2006-07-03 Thread Alex Martelli
Hari Sekhon <[EMAIL PROTECTED]> wrote: > I've written an except hook into a script as shown below which works > well for the most part and catches exceptions. > > import sys > def myexcepthook(type,value,tb): > do something > > sys.excepthook=myexcepthook > rest of script (now protected

catching syntax errors via excepthook?

2006-07-03 Thread Hari Sekhon
I've written an except hook into a script as shown below which works well for the most part and catches exceptions. import sys def myexcepthook(type,value,tb): do something sys.excepthook=myexcepthook rest of script (now protected by catchall exception hook) I've been intentionally int