From b8d617eaf05b3dc8ab8f44c38863dc14c31670a3 Mon Sep 17 00:00:00 2001 From: Thomas Kluyver Date: Fri, 15 Dec 2017 14:13:43 +0000 Subject: [PATCH] Backport PR #314: kill process group when killing kernel --- jupyter_client/manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jupyter_client/manager.py b/jupyter_client/manager.py index 585598c63..1b60b65a4 100644 --- a/jupyter_client/manager.py +++ b/jupyter_client/manager.py @@ -380,7 +380,10 @@ def _kill_kernel(self): # Signal the kernel to terminate (sends SIGKILL on Unix and calls # TerminateProcess() on Win32). try: - self.kernel.kill() + if hasattr(signal, 'SIGKILL'): + self.signal_kernel(signal.SIGKILL) + else: + self.kernel.kill() except OSError as e: # In Windows, we will get an Access Denied error if the process # has already terminated. Ignore it.