From dfb0d60d446f6cc2a484f5b8359d30fce9e5d51d 2010-04-25 05:43:42 From: Fernando Perez Date: 2010-04-25 05:43:42 Subject: [PATCH] Avoid unintentional gtk dependency. Closes https://bugs.launchpad.net/ipython/+bug/545456 --- diff --git a/IPython/Shell.py b/IPython/Shell.py index 1f084ba..56a39cd 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -1150,7 +1150,10 @@ class IPShellMatplotlibQt4(IPShellQt4): # Factory functions to actually start the proper thread-aware shell def check_gtk(mode): - import gtk + try: + import gtk + except ImportError: + return mode if hasattr(gtk,'set_interactive'): gtk.set_interactive(False) return 'tkthread'