From 7ad908bf092afa75c4dfcb07b625748240c4a314 2013-03-04 23:42:14 From: MinRK Date: 2013-03-04 23:42:14 Subject: [PATCH] Backport PR #2773: Fixed minor typo causing AttributeError to be thrown. I'm not sure how I caused the error to be thrown and couldn't reproduce it with the same call again, nevertheless I think the fix is correct. ```python In [21]: rc.shutdown(hub=True) Traceback (most recent call last): File "", line 1, in rc.shutdown(hub=True) File "", line 2, in shutdown File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 69, in spin_first self.spin() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 1005, in spin self._flush_notifications() File "c:\dev\code\ipython\IPython\parallel\client\client.py", line 800, in _flush_notifications raise Exception("Unhandled message type: %s"%msg.msg_type) AttributeError: 'dict' object has no attribute 'msg_type' ``` --- diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index a7c419f..31862dd 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -804,7 +804,7 @@ class Client(HasTraits): msg_type = msg['header']['msg_type'] handler = self._notification_handlers.get(msg_type, None) if handler is None: - raise Exception("Unhandled message type: %s"%msg.msg_type) + raise Exception("Unhandled message type: %s" % msg_type) else: handler(msg) idents,msg = self.session.recv(self._notification_socket, mode=zmq.NOBLOCK) @@ -818,7 +818,7 @@ class Client(HasTraits): msg_type = msg['header']['msg_type'] handler = self._queue_handlers.get(msg_type, None) if handler is None: - raise Exception("Unhandled message type: %s"%msg.msg_type) + raise Exception("Unhandled message type: %s" % msg_type) else: handler(msg) idents,msg = self.session.recv(sock, mode=zmq.NOBLOCK)