Skip to content
Browse files

Fix a couple of core tests under Python 3.

  • Loading branch information...
1 parent 2e01c88 commit 267e503ca77e1cfeda9219d57fa1dbd3a169b5dc @takluyver committed Oct 20, 2011
Showing with 5 additions and 2 deletions.
  1. +1 −1 IPython/core/tests/test_interactiveshell.py
  2. +4 −1 IPython/core/tests/test_magic.py
View
2 IPython/core/tests/test_interactiveshell.py
@@ -219,4 +219,4 @@ def tearDown(self):
def test_1(self):
"""Test safe_execfile with non-ascii path
"""
- _ip.shell.safe_execfile(self.fname, raise_exceptions=True)
+ _ip.shell.safe_execfile(self.fname, {}, raise_exceptions=True)
View
5 IPython/core/tests/test_magic.py
@@ -324,7 +324,10 @@ def check_cpaste(code, should_fail=False):
_ip.user_ns['code_ran'] = False
src = StringIO()
- src.encoding = None # IPython expects stdin to have an encoding attribute
+ try:
+ src.encoding = None # IPython expects stdin to have an encoding attribute
+ except Exception:
+ pass # ...but it's a read-only attribute in Python 3
src.write('\n')
src.write(code)
src.write('\n--\n')

0 comments on commit 267e503

Please sign in to comment.
Something went wrong with that request. Please try again.