Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r58282:09541f104186
Date: 2012-10-20 22:40 +0200
http://bitbucket.org/pypy/pypy/changeset/09541f104186/
Log: Remove pyexpat.Parser.returns_unicode (always True)
diff --git a/pypy/module/pyexpat/interp_pyexpat.py
b/pypy/module/pyexpat/interp_pyexpat.py
--- a/pypy/module/pyexpat/interp_pyexpat.py
+++ b/pypy/module/pyexpat/interp_pyexpat.py
@@ -410,7 +410,6 @@
self.w_intern = w_intern
- self.returns_unicode = True
self.ordered_attributes = False
self.specified_attributes = False
@@ -458,11 +457,8 @@
# Handlers management
def w_convert(self, space, s):
- if self.returns_unicode:
- from pypy.interpreter.unicodehelper import PyUnicode_DecodeUTF8
- return space.wrap(PyUnicode_DecodeUTF8(space, s))
- else:
- return space.wrapbytes(s)
+ from pypy.interpreter.unicodehelper import PyUnicode_DecodeUTF8
+ return space.wrap(PyUnicode_DecodeUTF8(space, s))
def w_convert_charp(self, space, data):
if data:
@@ -755,7 +751,6 @@
namespace_prefixes = GetSetProperty(W_XMLParserType.get_namespace_prefixes,
W_XMLParserType.set_namespace_prefixes,
cls=W_XMLParserType),
- returns_unicode = bool_property('returns_unicode', W_XMLParserType),
ordered_attributes = bool_property('ordered_attributes', W_XMLParserType),
specified_attributes = bool_property('specified_attributes',
W_XMLParserType),
intern = GetSetProperty(W_XMLParserType.get_intern, cls=W_XMLParserType),
diff --git a/pypy/module/pyexpat/test/test_parser.py
b/pypy/module/pyexpat/test/test_parser.py
--- a/pypy/module/pyexpat/test/test_parser.py
+++ b/pypy/module/pyexpat/test/test_parser.py
@@ -89,7 +89,6 @@
def gotText(text):
assert text == "caf\xe9"
p.CharacterDataHandler = gotText
- assert p.returns_unicode
p.Parse(xml)
def test_explicit_encoding(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit