diff --git a/IPython/zmq/ipkernel.py b/IPython/zmq/ipkernel.py index 098eb65..692e324 100755 --- a/IPython/zmq/ipkernel.py +++ b/IPython/zmq/ipkernel.py @@ -33,6 +33,7 @@ from IPython.core.shellapp import ( InteractiveShellApp, shell_flags, shell_aliases ) from IPython.utils import io +from IPython.utils import py3compat from IPython.utils.jsonutil import json_clean from IPython.lib import pylabtools from IPython.utils.traitlets import ( @@ -219,7 +220,10 @@ class Kernel(Configurable): # Replace raw_input. Note that is not sufficient to replace # raw_input in the user namespace. raw_input = lambda prompt='': self._raw_input(prompt, ident, parent) - __builtin__.raw_input = raw_input + if py3compat.PY3: + __builtin__.input = raw_input + else: + __builtin__.raw_input = raw_input # Set the parent message of the display hook and out streams. shell.displayhook.set_parent(parent) diff --git a/IPython/zmq/pykernel.py b/IPython/zmq/pykernel.py index 42835da..27f96d3 100755 --- a/IPython/zmq/pykernel.py +++ b/IPython/zmq/pykernel.py @@ -25,6 +25,7 @@ import traceback import zmq # Local imports. +from IPython.utils import py3compat from IPython.utils.traitlets import HasTraits, Instance, Dict, Float from completer import KernelCompleter from entry_point import base_launch_kernel @@ -116,7 +117,10 @@ class Kernel(HasTraits): # Replace raw_input. Note that is not sufficient to replace # raw_input in the user namespace. raw_input = lambda prompt='': self._raw_input(prompt, ident, parent) - __builtin__.raw_input = raw_input + if py3compat.PY3: + __builtin__.input = raw_input + else: + __builtin__.raw_input = raw_input # Set the parent message of the display hook and out streams. sys.displayhook.set_parent(parent)