Fix errors and fully support matplotlib interactive mode in run and debug with the...
[idea/community.git] / python / helpers / pydev / pydevconsole.py
index ff85bb212187e6109aee1e6a96449b455d38bdd0..3b98a0e626dcd20d111e1e1b4c555299a6297f0c 100644 (file)
@@ -155,9 +155,8 @@ def set_debug_hook(debug_hook):
     _ProcessExecQueueHelper._debug_hook = debug_hook
 
 
-def process_exec_queue(interpreter):
-
-    from pydev_ipython.inputhook import get_inputhook, set_return_control_callback
+def init_mpl_in_console(interpreter):
+    from pydev_ipython.inputhook import set_return_control_callback
 
     def return_control():
         ''' A function that the inputhooks can call (via inputhook.stdin_ready()) to find
@@ -187,6 +186,11 @@ def process_exec_queue(interpreter):
     import_hook_manager.add_module_name("pylab", activate_pylab)
     import_hook_manager.add_module_name("pyplot", activate_pyplot)
 
+
+def process_exec_queue(interpreter):
+    init_mpl_in_console(interpreter)
+    from pydev_ipython.inputhook import get_inputhook
+
     while 1:
         # Running the request may have changed the inputhook in use
         inputhook = get_inputhook()