From 716dedfe638c414af8619ec76b860644b9b6e43c Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 26 Aug 2012 00:26:52 +0200 Subject: wolframalpha: Ignore empty plaintext. --- modules/wolframalpha.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/wolframalpha.py b/modules/wolframalpha.py index 910698f..f13cdcb 100644 --- a/modules/wolframalpha.py +++ b/modules/wolframalpha.py @@ -39,7 +39,7 @@ class Module(object): for pod in xml.findall('pod'): #if pod.attrib['id'] == 'Result': result = pod.find('subpod/plaintext') - if result is not None: + if result is not None and result.text is not None: text = result.text text = whitespace_re.sub(' ', text) results.append('\002%s\002: %s' % (pod.attrib['title'], text)) -- cgit v1.2.3