From c8b6643327e639575505220e4987c3b89b81d0ae 2008-09-18 17:18:17 From: Ville M. Vainio Date: 2008-09-18 17:18:17 Subject: [PATCH] Fix #270856: IPython hangs with PyGTK --- diff --git a/IPython/Shell.py b/IPython/Shell.py index 9023fe6..aaa277e 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -776,6 +776,17 @@ class IPShellGTK(IPThread): debug=1,shell_class=MTInteractiveShell): import gtk + # Check for set_interactive, coming up in new pygtk. + # Disable it so that this code works, but notify + # the user that he has a better option as well. + # XXX TODO better support when set_interactive is released + try: + gtk.set_interactive(False) + print "Your PyGtk has set_interactive(), so you can use the" + print "more stable single-threaded Gtk mode." + print "See https://bugs.launchpad.net/ipython/+bug/270856" + except AttributeError: + pass self.gtk = gtk self.gtk_mainloop = hijack_gtk()