Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r73193:e9bdfdd996b2
Date: 2014-08-29 13:04 -0700
http://bitbucket.org/pypy/pypy/changeset/e9bdfdd996b2/
Log: n/a to py3, bytes.decode always returns unicode
diff --git a/pypy/interpreter/pyparser/pyparse.py
b/pypy/interpreter/pyparser/pyparse.py
--- a/pypy/interpreter/pyparser/pyparse.py
+++ b/pypy/interpreter/pyparser/pyparse.py
@@ -8,8 +8,6 @@
return bytes
w_text = space.call_method(space.wrapbytes(bytes), "decode",
space.wrap(encoding))
- if not space.isinstance_w(w_text, space.w_unicode):
- raise error.SyntaxError("codec did not return a unicode object")
w_recoded = space.call_method(w_text, "encode", space.wrap("utf-8"))
return space.bytes_w(w_recoded)
diff --git a/pypy/interpreter/pyparser/test/test_pyparse.py
b/pypy/interpreter/pyparser/test/test_pyparse.py
--- a/pypy/interpreter/pyparser/test/test_pyparse.py
+++ b/pypy/interpreter/pyparser/test/test_pyparse.py
@@ -40,13 +40,6 @@
tree = self.parse("a日本 = 32")
tree = self.parse("日本 = 32")
- def test_non_unicode_codec(self):
- exc = py.test.raises(SyntaxError, self.parse, """\
-# coding: string-escape
-\x70\x72\x69\x6e\x74\x20\x32\x2b\x32\x0a
-""").value
- assert exc.msg == "codec did not return a unicode object"
-
def test_syntax_error(self):
parse = self.parse
exc = py.test.raises(SyntaxError, parse, "name another for").value
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit