From f2b0531c53f01812139668456694b402d429a450 Mon Sep 17 00:00:00 2001 From: dalthviz Date: Wed, 25 Oct 2017 21:52:42 -0500 Subject: [PATCH] Add handling for RuntimeError while closing an IPython console instance. --- spyder/plugins/ipythonconsole.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spyder/plugins/ipythonconsole.py b/spyder/plugins/ipythonconsole.py index 378f57dbd0c..3e31e218901 100644 --- a/spyder/plugins/ipythonconsole.py +++ b/spyder/plugins/ipythonconsole.py @@ -1249,8 +1249,12 @@ def close_client(self, index=None, client=None, force=False): if index is not None: client = self.tabwidget.widget(index) - # Close client - client.stop_button_click_handler() + # Needed to handle a RuntimeError. See issue 5568. + try: + # Close client + client.stop_button_click_handler() + except RuntimeError: + pass # Check if related clients or kernels are opened # and eventually ask before closing them