Skip to content

Commit

Permalink
Tweak test for magic_cpaste.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Oct 26, 2011
1 parent 155b20c commit 15192a1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions IPython/core/tests/test_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,9 @@ def check_cpaste(code, should_fail=False):
_ip.user_ns['code_ran'] = False

src = StringIO()
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
if not hasattr(src, 'encoding'):
# IPython expects stdin to have an encoding attribute
src.encoding = None
src.write('\n')
src.write(code)
src.write('\n--\n')
Expand Down

0 comments on commit 15192a1

Please sign in to comment.