Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: In inprocess tests, use input/raw_input depending on Python vers…

…ion.
  • Loading branch information...
commit 775571cd4d59a1c5ef9d96fdf2a71e95798ab8dc 1 parent 36f98b6
@pberkes authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 IPython/inprocess/tests/test_kernel.py
View
6 IPython/inprocess/tests/test_kernel.py
@@ -21,6 +21,7 @@
from IPython.inprocess.ipkernel import InProcessKernel
from IPython.testing.decorators import skipif_not_matplotlib
from IPython.utils.io import capture_output
+from IPython.utils import py3compat
#-----------------------------------------------------------------------------
# Test case
@@ -48,7 +49,10 @@ def test_raw_input(self):
sys_stdin = sys.stdin
sys.stdin = io
try:
- km.shell_channel.execute('x = raw_input()')
+ if py3compat.PY3:
+ km.shell_channel.execute('x = input()')
+ else:
+ km.shell_channel.execute('x = raw_input()')
finally:
sys.stdin = sys_stdin
self.assertEqual(km.kernel.shell.user_ns.get('x'), 'foobar')
Please sign in to comment.
Something went wrong with that request. Please try again.