Skip to content

Commit

Permalink
Merge pull request #348 from Carreau/ipython-7x-compat
Browse files Browse the repository at this point in the history
IPython 7.x compatibility
  • Loading branch information
Carreau authored Sep 25, 2018
2 parents 5a5deba + fd95855 commit dda8798
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ipykernel/kernelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def log_connection_info(self):
# also raw print to the terminal if no parent_handle (`ipython kernel`)
# unless log-level is CRITICAL (--quiet)
if not self.parent_handle and self.log_level < logging.CRITICAL:
io.rprint(_ctrl_c_message)
io.raw_print(_ctrl_c_message)
for line in lines:
io.rprint(line)
io.raw_print(line)

self.ports = dict(shell=self.shell_port, iopub=self.iopub_port,
stdin=self.stdin_port, hb=self.hb_port,
Expand Down
2 changes: 1 addition & 1 deletion ipykernel/kernelbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ def _input_request(self, prompt, ident, parent, password=False):
def _at_shutdown(self):
"""Actions taken at shutdown by the kernel, called by python's atexit.
"""
# io.rprint("Kernel at_shutdown") # dbg
# io.raw_print("Kernel at_shutdown") # dbg
if self._shutdown_message is not None:
self.session.send(self.iopub_socket, self._shutdown_message, ident=self._topic('shutdown'))
self.log.debug("%s", self._shutdown_message)
Expand Down
5 changes: 3 additions & 2 deletions ipykernel/tests/test_message_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,9 @@ def test_comm_info_request():

def test_single_payload():
flush_channels()
msg_id, reply = execute(code="for i in range(3):\n"+
" x=range?\n")
msg_id, reply = execute(code="ip = get_ipython()\n"
"for i in range(3):\n"
" ip.set_next_input('Hello There')\n")
payload = reply['payload']
next_input_pls = [pl for pl in payload if pl["source"] == "set_next_input"]
assert len(next_input_pls) == 1
Expand Down

0 comments on commit dda8798

Please sign in to comment.