Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r70293:1e0b20cb98d7
Date: 2014-03-25 16:55 -0700
http://bitbucket.org/pypy/pypy/changeset/1e0b20cb98d7/
Log: adapt to py3, which allows bytes or unicode here
diff --git a/pypy/module/_codecs/test/test_codecs.py
b/pypy/module/_codecs/test/test_codecs.py
--- a/pypy/module/_codecs/test/test_codecs.py
+++ b/pypy/module/_codecs/test/test_codecs.py
@@ -772,10 +772,10 @@
assert u'\u040a'.encode('mbcs') == b'?' # some cyrillic letter
assert b'cafx\e9'.decode('mbcs') == u'cafx\e9'
- def test_bad_handler_string_result(self):
+ def test_handler_string_result(self):
import _codecs
def f(exc):
return (b'foo', exc.end)
_codecs.register_error("test.test_codecs_not_a_string", f)
- raises(TypeError, u'\u1234'.encode, 'ascii',
- 'test.test_codecs_not_a_string')
+ result = '\u1234'.encode('ascii', 'test.test_codecs_not_a_string')
+ assert result == b'foo'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit