From a8f2ab2a2606ed85e0578aa348de84b14a9185fb 2013-01-18 05:28:44 From: Brian E. Granger Date: 2013-01-18 05:28:44 Subject: [PATCH] Final cleanup of kernelmanager * Separated cleanup of connection file and ipc files * Removed periods --- diff --git a/IPython/zmq/kernelmanager.py b/IPython/zmq/kernelmanager.py index 3165902..ca578c6 100644 --- a/IPython/zmq/kernelmanager.py +++ b/IPython/zmq/kernelmanager.py @@ -709,6 +709,7 @@ class KernelManager(Configurable): def __del__(self): self.cleanup_connection_file() + self.cleanup_ipc_files() #-------------------------------------------------------------------------- # Channel management methods: @@ -805,7 +806,7 @@ class KernelManager(Configurable): return self._hb_channel #-------------------------------------------------------------------------- - # Connection and ipc file management. + # Connection and ipc file management #-------------------------------------------------------------------------- def cleanup_connection_file(self): @@ -820,8 +821,6 @@ class KernelManager(Configurable): os.remove(self.connection_file) except (IOError, OSError): pass - - self.cleanup_ipc_files() def cleanup_ipc_files(self): """Cleanup ipc files if we wrote them.""" @@ -866,7 +865,7 @@ class KernelManager(Configurable): self._connection_file_written = True #-------------------------------------------------------------------------- - # Kernel management. + # Kernel management #-------------------------------------------------------------------------- def start_kernel(self, **kw): @@ -949,6 +948,7 @@ class KernelManager(Configurable): if not restart: self.cleanup_connection_file() + self.cleanup_ipc_files() else: self.cleanup_ipc_files() diff --git a/IPython/zmq/kernelmanagerabc.py b/IPython/zmq/kernelmanagerabc.py index d0f4a30..61ba1ca 100644 --- a/IPython/zmq/kernelmanagerabc.py +++ b/IPython/zmq/kernelmanagerabc.py @@ -161,7 +161,7 @@ class KernelManagerABC(object): pass #-------------------------------------------------------------------------- - # Channel management methods: + # Channel management methods #-------------------------------------------------------------------------- @abc.abstractmethod @@ -193,7 +193,7 @@ class KernelManagerABC(object): pass #-------------------------------------------------------------------------- - # Kernel management. + # Kernel management #-------------------------------------------------------------------------- @abc.abstractmethod @@ -223,3 +223,4 @@ class KernelManagerABC(object): @abc.abstractproperty def is_alive(self): pass + diff --git a/IPython/zmq/tests/test_kernelmanager.py b/IPython/zmq/tests/test_kernelmanager.py index f6482c2..9a1973d 100644 --- a/IPython/zmq/tests/test_kernelmanager.py +++ b/IPython/zmq/tests/test_kernelmanager.py @@ -1,4 +1,4 @@ -"""Tests for the notebook kernel and session manager.""" +"""Tests for the notebook kernel and session manager""" from subprocess import PIPE import time