Permalink
Browse files

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

…ion.
  • Loading branch information...
1 parent 36f98b6 commit 775571cd4d59a1c5ef9d96fdf2a71e95798ab8dc @pberkes committed Dec 27, 2012
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')

0 comments on commit 775571c

Please sign in to comment.