Parser queue flushing

- the parser queue wasn't flushed when there's an exception resulting in
  the wrong message being displayed selected
This commit is contained in:
Peter Šurda 2016-10-27 23:09:31 +02:00
parent 22eb4d62bf
commit 5c9bfe09a2
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -131,7 +131,14 @@ class SafeHTMLParser(HTMLParser):
parserProcess.start() parserProcess.start()
parserLock.release() parserLock.release()
else: else:
pass # flush queue
try:
while True:
tmp = parserOutputQueue.get(False)
except Queue.Empty:
logger.debug("Parser queue flushed")
pass
self.raw += tmp self.raw += tmp
def is_html(self, text = None, allow_picture = False): def is_html(self, text = None, allow_picture = False):