From d014286487113ba5012d4d45d9dbfb8fe9f9a7f5 2014-07-29 19:27:56 From: Sylvain Corlay Date: 2014-07-29 19:27:56 Subject: [PATCH] unregister and register both take comm as argument --- diff --git a/IPython/kernel/comm/manager.py b/IPython/kernel/comm/manager.py index a4c5e5f..152a711 100644 --- a/IPython/kernel/comm/manager.py +++ b/IPython/kernel/comm/manager.py @@ -72,10 +72,10 @@ class CommManager(LoggingConfigurable): self.comms[comm_id] = comm return comm_id - def unregister_comm(self, comm_id): + def unregister_comm(self, comm): """Unregister a comm, and close its counterpart""" # unlike get_comm, this should raise a KeyError - comm = self.comms.pop(comm_id) + comm = self.comms.pop(comm.comm_id) def get_comm(self, comm_id): """Get a comm with a particular id @@ -115,7 +115,7 @@ class CommManager(LoggingConfigurable): except Exception: self.log.error("Exception opening comm with target: %s", target_name, exc_info=True) comm.close() - self.unregister_comm(comm_id) + self.unregister_comm(comm) def comm_msg(self, stream, ident, msg): """Handler for comm_msg messages"""