pygobject timeout exception handling.

Status
Not open for further replies.

Philippe23

Ars Centurion
367
Subscriptor++
Code:
import gobject

def ThrowException():
    raise Exception('Exception that won't exit')
    return False

gobject.idle_add(ThrowException)

l = gobject.MainLoop()
print 'Starting mainloop'
l.run()
print 'This never gets shown.'

Does anybody know how to install a "default" exception handler for pygobject timeout thrown exceptions? The above code will just print the exception, but not exit. I'd like to at least be able to catch it and call gobject.main_quit().

(Note that in the example, I'm throwing the exception, but I really want to handle unexpected exceptions by getting the mainloop to quit after displaying them.)

Thanks for suggestions in advance!
 
Status
Not open for further replies.