A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ipython/ipython/issues/825/ below:

keyboardinterrupt crashes gtk gui when gtk.set_interactive is not available · Issue #825 · ipython/ipython · GitHub

older gtk versions do not have gtk.set_interactive available which causes ipython to "use our own ctypes version":
IPython/lib/inputhook.py

240         import gtk
241         try:
242             gtk.set_interactive(True)
243             self._current_gui = GUI_GTK
244         except AttributeError:
245             # For older versions of gtk, use our own ctypes version
246             from IPython.lib.inputhookgtk import inputhook_gtk
247             self.set_inputhook(inputhook_gtk)
248             self._current_gui = GUI_GTK

this alternative does not handle keyboard interrupts well:

# make ipython use alternative, e.g. by using old gtk version or by editing:
# sed -i -e "s/gtk.set_interactive/gtk.garrbage/" IPython/lib/inputhook.py

ipython --pylab="gtk"
IN[1]: ^C
KeyboardInterrupt    Python 2.7.2+: /home/jtaylor/chroots/python/bin/python
                                                   Thu Sep 29 23:56:04 2011
A problem occured executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/home/jtaylor/chroots/python/_ctypes/callbacks.c in 'calling callback function'()

/home/jtaylor/chroots/python/lib/python2.7/site-packages/IPython/lib/inputhookgtk.pyc in inputhook_gtk()
     18 
     19 import sys
     20 import gtk, gobject
     21 
     22 #-----------------------------------------------------------------------------
     23 # Code
     24 #-----------------------------------------------------------------------------
     25 
     26 
     27 def _main_quit(*args, **kwargs):
     28     gtk.main_quit()
     29     return False
     30 
     31 def inputhook_gtk():
     32     gobject.io_add_watch(sys.stdin, gobject.IO_IN, _main_quit)
---> 33     gtk.main()
     34     return 0
     35 

KeyboardInterrupt: 

**********************************************************************

Oops, ipython crashed. We do our best to make it stable, but...

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4