Philip Jenvey committed 0f6032e

fix the funny merge from default of Parse and a related test

Comments (0)

Files changed (2)


     # 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


         assert e.value.code ==[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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.