From fe5498f4f64879500ba4f944d7ef4add5985e1ef Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 18 Aug 2018 12:06:23 -0500 Subject: [PATCH] IPython console: Catch any error generated when trying to start kernels --- spyder/plugins/ipythonconsole.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index 240ca8760ce..50805a00639 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -1556,7 +1556,15 @@ def create_kernel_manager_and_kernel_client(self, connection_file, stderr = None else: stderr = None - kernel_manager.start_kernel(stderr=stderr) + + # Catch any error generated when trying to start the kernel + # See issue 7302 + try: + kernel_manager.start_kernel(stderr=stderr) + except Exception: + error_msg = _("The error is:

" + "{}").format(traceback.format_exc()) + return (error_msg, None) # Kernel client kernel_client = kernel_manager.client()