Remove redundent _handle_close method

This commit is contained in:
Jonathan Frederic 2013-12-20 17:22:06 -08:00 committed by Jonathan Frederic
parent 857ae831fb
commit 996d133710

View File

@ -426,18 +426,16 @@ class Widget(LoggingConfigurable):
if not hasattr(self, '_comm') or self._comm is None: if not hasattr(self, '_comm') or self._comm is None:
self._comm = Comm(target_name=self.target_name) self._comm = Comm(target_name=self.target_name)
self._comm.on_msg(self._handle_msg) self._comm.on_msg(self._handle_msg)
self._comm.on_close(self._handle_close) self._comm.on_close(self._close_communication)
def _handle_close(self):
"""Called when the comm is closed by the front-end."""
self._close_communication()
def _close_communication(self): def _close_communication(self):
"""Closes a communication with the front-end.""" """Closes a communication with the front-end."""
if hasattr(self, '_comm') and self._comm is not None: if hasattr(self, '_comm') and self._comm is not None:
self._comm.close() try:
self._comm.close()
finally:
self._comm = None
def _send(self, msg): def _send(self, msg):