Permalink
Browse files

remove set_interactive gtk check (fix #185)

It was unclear why the function check_gtk() was added in the first
place, but plt.show() blocked when using "ipython -gthread" without
the "-pylab"

also, I just want to note here that users will still experience blocking
behaviour if they use e.g "ipython -gthread" but their matplotlib is set
to some other backend by default (say "WX").
  • Loading branch information...
1 parent 972dc9b commit 7fb20baae1413fd1ead99f700fc891d6ee7807dd @ivanov committed Dec 29, 2010
Showing with 0 additions and 21 deletions.
  1. +0 −21 IPython/Shell.py
View
21 IPython/Shell.py
@@ -1149,19 +1149,6 @@ def __init__(self,argv=None,user_ns=None,user_global_ns=None,debug=1):
#-----------------------------------------------------------------------------
# Factory functions to actually start the proper thread-aware shell
-def check_gtk(mode):
- try:
- import gtk
- except (ImportError, RuntimeError):
- # GTK not present, or can't be started (no X11, happens in console)
- return mode
- if hasattr(gtk,'set_interactive'):
- gtk.set_interactive(False)
- return 'tkthread'
- else:
- return mode
-
-
def _select_shell(argv):
"""Select a shell from the given argv vector.
@@ -1231,21 +1218,13 @@ def _select_shell(argv):
else:
# Any other backend, use plain Tk
th_mode = 'tkthread'
-
- # New versions of pygtk don't need the brittle threaded support.
- th_mode = check_gtk(th_mode)
-
return mpl_shell[th_mode]
else:
# No pylab requested, just plain threads
try:
th_mode = special_opts.pop()
except KeyError:
th_mode = 'tkthread'
-
- # New versions of pygtk don't need the brittle threaded support.
- if th_mode == 'gthread':
- th_mode = check_gtk(th_mode)
return th_shell[th_mode]

0 comments on commit 7fb20ba

Please sign in to comment.