Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r61103:0f6032e23564
Date: 2013-02-11 13:42 -0800
http://bitbucket.org/pypy/pypy/changeset/0f6032e23564/
Log: fix the funny merge from default of Parse and a related test
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
@@ -616,15 +616,10 @@
# Parse methods
- @unwrap_spec(isfinal=bool)
- def Parse(self, space, w_data, isfinal=False):
+ @unwrap_spec(data='bufferstr_or_u', isfinal=bool)
+ def Parse(self, space, data, isfinal=False):
"""Parse(data[, isfinal])
Parse XML data. `isfinal' should be true at end of input."""
-
- if space.isinstance_w(w_data, space.w_bytes):
- data = space.bytes_w(w_data)
- else:
- data = space.str_w(w_data)
res = XML_Parse(self.itself, data, len(data), isfinal)
if self._exc_info:
e = self._exc_info
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
@@ -162,12 +162,12 @@
assert e.value.code == errors.codes[errors.XML_ERROR_UNCLOSED_TOKEN]
def test_read_chunks(self):
+ import io
import pyexpat
- import StringIO
from contextlib import closing
- xml = '<xml>' + (' ' * 4096) + '</xml>'
- with closing(StringIO.StringIO(xml)) as sio:
+ xml = b'<xml>' + (b' ' * 4096) + b'</xml>'
+ with closing(io.BytesIO(xml)) as sio:
class FakeReader():
def __init__(self):
self.read_count = 0
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit