diff --git a/IPython/lib/inputhook.py b/IPython/lib/inputhook.py index bdb7be3..44cebbb 100644 --- a/IPython/lib/inputhook.py +++ b/IPython/lib/inputhook.py @@ -320,8 +320,11 @@ class InputHookManager(object): """ self._current_gui = GUI_TK if app is None: - import tkinter - app = tkinter.Tk() + try: + from tkinter import Tk # Py 3 + except ImportError: + from Tkinter import Tk # Py 2 + app = Tk() app.withdraw() self._apps[GUI_TK] = app return app