##// END OF EJS Templates
ensure replies from ipkernel are clean for JSON
MinRK -
Show More
@@ -303,6 +303,7 class Kernel(Configurable):
303 303 time.sleep(self._execute_sleep)
304 304
305 305 # Send the reply.
306 reply_content = json_clean(reply_content)
306 307 reply_msg = self.session.send(self.shell_socket, u'execute_reply',
307 308 reply_content, parent, ident=ident)
308 309 self.log.debug(str(reply_msg))
@@ -321,6 +322,7 class Kernel(Configurable):
321 322 matches = {'matches' : matches,
322 323 'matched_text' : txt,
323 324 'status' : 'ok'}
325 matches = json_clean(matches)
324 326 completion_msg = self.session.send(self.shell_socket, 'complete_reply',
325 327 matches, parent, ident)
326 328 self.log.debug(str(completion_msg))
@@ -358,6 +360,7 class Kernel(Configurable):
358 360 else:
359 361 hist = []
360 362 content = {'history' : list(hist)}
363 content = json_clean(content)
361 364 msg = self.session.send(self.shell_socket, 'history_reply',
362 365 content, parent, ident)
363 366 self.log.debug(str(msg))
@@ -409,7 +412,7 class Kernel(Configurable):
409 412 sys.stdout.flush()
410 413
411 414 # Send the input request.
412 content = dict(prompt=prompt)
415 content = json_clean(dict(prompt=prompt))
413 416 msg = self.session.send(self.stdin_socket, u'input_request', content, parent)
414 417
415 418 # Await a response.
General Comments 0
You need to be logged in to leave comments. Login now