Here is my own solution:
In the Objective-C class:
@try {
[section loop];
} @catch (NSException *exception) {
NSLog(@"main: Caught %@: %@", [exception name], [exception reason]);
[self exception: [[exception userInfo] valueForKey: @"__pyobjc_exc_traceback__"]];
}
In a subclass of pyobjc python:
def exception_(self,trace):
traceback.print_tb(trace)
NSApplication.sharedApplication().terminate_(None)
Of course, I imported the trace module.
source
share