From 5c9bfe09a29ee44f91fb4a926d4086d4d258e890 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 27 Oct 2016 23:09:31 +0200 Subject: [PATCH] Parser queue flushing - the parser queue wasn't flushed when there's an exception resulting in the wrong message being displayed selected --- src/bitmessageqt/safehtmlparser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/bitmessageqt/safehtmlparser.py b/src/bitmessageqt/safehtmlparser.py index b6fb8ca9..1ca9cbb0 100644 --- a/src/bitmessageqt/safehtmlparser.py +++ b/src/bitmessageqt/safehtmlparser.py @@ -131,7 +131,14 @@ class SafeHTMLParser(HTMLParser): parserProcess.start() parserLock.release() else: - pass + # flush queue + try: + while True: + tmp = parserOutputQueue.get(False) + except Queue.Empty: + logger.debug("Parser queue flushed") + pass + self.raw += tmp def is_html(self, text = None, allow_picture = False):