From 01de31e677f52b45ba04c6aaaed7190857f8eb15 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Tue, 14 Nov 2017 19:50:08 -0500 Subject: [PATCH] Catch TypeError while executing code instructions in the IPython console. --- spyder/plugins/ipythonconsole.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index 3e31e218901..880df084599 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -945,7 +945,11 @@ def execute_code(self, lines, current_client=True, clear_variables=False): if not current_client: # Clear console and reset namespace for # dedicated clients - sw.sig_prompt_ready.disconnect() + # See issue 5748 + try: + sw.sig_prompt_ready.disconnect() + except TypeError: + pass sw.silent_execute( 'get_ipython().kernel.close_all_mpl_figures()') sw.reset_namespace(warning=False, silent=True)