From 7228c9cf6d78d855afab90c8ce95850dd2712c14 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 3 May 2017 16:07:11 +0100 Subject: Avoid some deprecation warnings when casting raw XML into bool. (thanks pypy3) --- poezio/xhtml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'poezio/xhtml.py') diff --git a/poezio/xhtml.py b/poezio/xhtml.py index 59c2ac7c..3d988806 100644 --- a/poezio/xhtml.py +++ b/poezio/xhtml.py @@ -198,10 +198,10 @@ def get_body_from_message_stanza(message, use_xhtml=False, if not use_xhtml: return message['body'] xhtml = message.xml.find('{http://jabber.org/protocol/xhtml-im}html') - if not xhtml: + if xhtml is not None: return message['body'] xhtml_body = xhtml.find('{http://www.w3.org/1999/xhtml}body') - if not xhtml_body: + if xhtml_body is not None: return message['body'] content = xhtml_to_poezio_colors(xhtml_body, tmp_dir=tmp_dir, extract_images=extract_images) -- cgit v1.2.3