There was an error while loading. Please reload this page.
1 parent e208bf0 commit 9c1e35fCopy full SHA for 9c1e35f
1 file changed
Lib/html/parser.py
@@ -192,6 +192,17 @@ def feed(self, data):
192
# Nothing was parsed; wait until the buffer doubles.
193
self._parse_threshold = len(self.rawdata)
194
195
+ def flush(self):
196
+ """Process all data fed insofar as it consists of complete elements.
197
+ Incomplete data remains buffered.
198
+ """
199
+ if self._pending:
200
+ self.rawdata += ''.join(self._pending)
201
+ self._pending.clear()
202
+ self._pending_len = 0
203
+ self._parse_threshold = 1
204
+ self.goahead(0)
205
+
206
def close(self):
207
"""Handle any buffered data."""
208
if self._pending:
0 commit comments