diff options
Diffstat (limited to 'pip/_vendor/html5lib/inputstream.py')
-rw-r--r-- | pip/_vendor/html5lib/inputstream.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pip/_vendor/html5lib/inputstream.py b/pip/_vendor/html5lib/inputstream.py index 0ac70bb3a..f3dfd7f3d 100644 --- a/pip/_vendor/html5lib/inputstream.py +++ b/pip/_vendor/html5lib/inputstream.py @@ -43,7 +43,7 @@ ascii_punctuation_re = re.compile("[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005 charsUntilRegEx = {} -class BufferedStream: +class BufferedStream(object): """Buffering for streams that do not have buffering of their own The buffer is implemented as a list of chunks on the assumption that @@ -63,11 +63,11 @@ class BufferedStream: return pos def seek(self, pos): - assert pos < self._bufferedBytes() + assert pos <= self._bufferedBytes() offset = pos i = 0 while len(self.buffer[i]) < offset: - offset -= pos + offset -= len(self.buffer[i]) i += 1 self.position = [i, offset] @@ -114,7 +114,7 @@ class BufferedStream: if remainingBytes: rv.append(self._readStream(remainingBytes)) - return "".join(rv) + return b"".join(rv) def HTMLInputStream(source, encoding=None, parseMeta=True, chardet=True): @@ -132,7 +132,7 @@ def HTMLInputStream(source, encoding=None, parseMeta=True, chardet=True): return HTMLBinaryInputStream(source, encoding, parseMeta, chardet) -class HTMLUnicodeInputStream: +class HTMLUnicodeInputStream(object): """Provides a unicode stream of characters to the HTMLTokenizer. This class takes care of character encoding and removing or replacing |