[Pyobjc-dev] sys.excepthook and AppHelper.runEventLoop
Brought to you by:
ronaldoussoren
From: Benjamin S. <bcs...@gm...> - 2012-11-19 22:40:11
|
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 |