From 5f78dbb5a2ba060c116853aa7f083f69465f53d6 Mon Sep 17 00:00:00 2001 From: Aashish Chaudhary Date: Wed, 30 Aug 2017 11:52:49 -0400 Subject: [PATCH] Fixed running the kernel in Python3.x --- geonotebook/kernel.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/geonotebook/kernel.py b/geonotebook/kernel.py index 4eb588b..267a218 100644 --- a/geonotebook/kernel.py +++ b/geonotebook/kernel.py @@ -230,7 +230,7 @@ def make_param(p, default=False): predicate=lambda x: ismethod(x) or isfunction(x) ) if fn in cls.msg_types} - return cls._protocol.values() + return list(cls._protocol.values()) def _send_msg(self, msg): """Send a message to the client. @@ -256,7 +256,7 @@ def _reconcile_parameters(self, method, params): for p in self._protocol[method]['required']] except KeyError: raise jsonrpc.InvalidParams( - u"missing required params for method: %s" % method + "missing required params for method: %s" % method ) kwargs = {p['key']: param_hash[p['key']]['value'] @@ -281,7 +281,7 @@ def _recv_msg(self, msg): # Otherwise process the request from the remote RPC client. elif is_request(msg): method, params = msg['method'], msg['params'] - if method in self._protocol.keys(): + if method in list(self._protocol.keys()): try: args, kwargs = self._reconcile_parameters(method, params) @@ -489,10 +489,10 @@ def handle_comm_msg(self, message): self.geonotebook._send_msg( json_rpc_result(None, e.tojson(), msg['id']) ) - self.log.error(u"JSONRPCError (%s): %s" % (e.code, e.message)) + self.log.error("JSONRPCError (%s): %s" % (e.code, e.message)) except Exception as e: - self.log.error(u"Error processing msg: {}".format(str(e))) + self.log.error("Error processing msg: {}".format(str(e))) def handle_comm_open(self, comm, msg): """Handle opening a comm.