From 3e57a662438383bb52a6cc249b9f87c67de76753 2012-02-08 21:35:24 From: MinRK Date: 2012-02-08 21:35:24 Subject: [PATCH] ignore IOPub messages with no parent. Generally caused by print statements or warnings from before the first execution. --- diff --git a/IPython/parallel/client/client.py b/IPython/parallel/client/client.py index 82e1e0a..e7fd57d 100644 --- a/IPython/parallel/client/client.py +++ b/IPython/parallel/client/client.py @@ -726,6 +726,10 @@ class Client(HasTraits): if self.debug: pprint(msg) parent = msg['parent_header'] + # ignore IOPub messages with no parent. + # Caused by print statements or warnings from before the first execution. + if not parent: + continue msg_id = parent['msg_id'] content = msg['content'] header = msg['header']