From edfa4edabc3f9493871def07c183a4914a5b0b2d 2014-11-12 19:29:10 From: Min RK Date: 2014-11-12 19:29:10 Subject: [PATCH] handle setting Widget.comm = None which is done in `Widget.close` fixes loads of warnings in widget test output, caused every time a widget is closed. --- diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py index 0eccf42..5a398fc 100644 --- a/IPython/html/widgets/widget.py +++ b/IPython/html/widgets/widget.py @@ -175,7 +175,8 @@ class Widget(LoggingConfigurable): def _comm_changed(self, name, new): """Called when the comm is changed.""" - self.comm = new + if new is None: + return self._model_id = self.model_id self.comm.on_msg(self._handle_msg)