From 5f9018f5b9551a0ca7efff39ff7c966d346d81d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sat, 21 Apr 2018 12:13:36 +0200 Subject: [PATCH] Fix Error when shutting down Jupyter --- src/python/cutter_jupyter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/python/cutter_jupyter.py b/src/python/cutter_jupyter.py index ac3214ce..41a5a7c8 100644 --- a/src/python/cutter_jupyter.py +++ b/src/python/cutter_jupyter.py @@ -11,7 +11,6 @@ class IPyKernelInterfaceJupyter: self._id = id def send_signal(self, signum): - print("sending signal " + str(signum) + " to kernel") cutter_internal.kernel_interface_send_signal(self._id, signum) def kill(self): @@ -101,7 +100,8 @@ class CutterNotebookApp(NotebookApp): def stop(self): super().stop() - self.thread.join() + if self.thread is not None: + self.thread.join() def init_signal(self): # This would call signal.signal(signal.SIGINT, signal.SIG_IGN) @@ -120,6 +120,7 @@ def start_jupyter(): asyncio.set_event_loop(asyncio.new_event_loop()) app = CutterNotebookApp() # app.log_level = logging.DEBUG + app.thread = threading.current_thread() app.initialize() q.put(app) app.start()