From 26a174e208a6ba001ba6c4564dbf896b90a360ed 2014-01-16 10:57:00 From: Jonathan Frederic Date: 2014-01-16 10:57:00 Subject: [PATCH] Added check on widget close to make sure comm isn't already none. --- diff --git a/IPython/html/widgets/widget.py b/IPython/html/widgets/widget.py index 687742a..47c2150 100644 --- a/IPython/html/widgets/widget.py +++ b/IPython/html/widgets/widget.py @@ -98,8 +98,11 @@ class Widget(LoggingConfigurable): """Close method. Closes the widget which closes the underlying comm. When the comm is closed, all of the widget views are automatically removed from the frontend.""" - self._comm.close() - del self._comm + try: + self._comm.close() + del self._comm + except: + pass # Comm doesn't exist and/or is already closed. # Properties