sys.excepthook and AppHelper.runEventLoop

Benjamin Smith <[email protected]> Mon, 19 Nov 2012 14:40:00 -0800
Newsgroups gmane.comp.python.pyobjc.devel
Message-ID <[email protected]>
Hi all,

I have a python script that I'm bundling with py2app and run using AppHelper.runEventLoop.  In my script, I set sys.excepthook to a custom function in order to do some cleanup when there is an unhandled exception.  However, because runEventLoop runs the entire runloop inside a try, except block, sys.excepthook is never called and the application simply terminates.  It looks like the only way to mimic this behavior is to pass in my cleanup code within the 'unexpectedErrorAlert' parameter to runEventLoop, but that seemed to not be the best approach.  Is there another way to mimic sys.excepthook that I'm missing?

Thanks!
Ben
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov