From edff99efdfdd9e18b01441931f177c56e99cb61e 2010-08-03 18:14:16 From: Brian Granger Date: 2010-08-03 18:14:16 Subject: [PATCH] Channels can no longer be restarted. --- diff --git a/IPython/zmq/kernelmanager.py b/IPython/zmq/kernelmanager.py index 414bd87..82529bd 100644 --- a/IPython/zmq/kernelmanager.py +++ b/IPython/zmq/kernelmanager.py @@ -44,14 +44,13 @@ class ZmqSocketChannel(Thread): self.socket = None def stop(self): - """ Stop the thread's activity. Returns when the thread terminates. + """Stop the thread's activity. Returns when the thread terminates. + + The thread will raise :class:`RuntimeError` if :method:`self.start` + is called again. """ self.join() - # Allow the thread to be started again. - # FIXME: Although this works (and there's no reason why it shouldn't), - # it feels wrong. Is there a cleaner way to achieve this? - Thread.__init__(self) def get_address(self): """ Get the channel's address. By the default, a channel is on @@ -65,7 +64,7 @@ class ZmqSocketChannel(Thread): or None, in which case the address is reset to its default value. """ # FIXME: Validate address. - if self.is_alive(): + if self.is_alive(): # This is Thread.is_alive raise RuntimeError("Cannot set address on a running channel!") else: if address is None: