mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Added check on widget close to make sure comm isn't already none.
This commit is contained in:
parent
8daa879087
commit
742ad511f6
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user