Ticket #3203: 3203-win.diff

File 3203-win.diff, 948 bytes (added by therve, 8 years ago)
  • twisted/internet/gtk2reactor.py

     
    243243        selectreactor.SelectReactor.crash(self)
    244244        import gtk
    245245        # mainquit is deprecated in newer versions
    246         if hasattr(gtk, 'main_quit'):
    247             gtk.main_quit()
    248         else:
    249             gtk.mainquit()
     246        if gtk.main_level():
     247            if hasattr(gtk, 'main_quit'):
     248                gtk.main_quit()
     249            else:
     250                gtk.mainquit()
    250251
    251252    def run(self, installSignalHandlers=1):
    252253        import gtk
    253254        self.startRunning(installSignalHandlers=installSignalHandlers)
    254         self.simulate()
     255        gobject.timeout_add(0, self.simulate)
    255256        # mainloop is deprecated in newer versions
    256257        if hasattr(gtk, 'main'):
    257258            gtk.main()