def crash(self): import gtk # mainquit is deprecated in newer versions if hasattr(gtk, 'main_quit'): gtk.main_quit() else: gtk.mainquit()