summaryrefslogtreecommitdiff
path: root/searx/utils.py
diff options
context:
space:
mode:
authorAlexandre Flament <alex@al-f.net>2020-12-17 09:57:57 +0100
committerAlexandre Flament <alex@al-f.net>2020-12-20 09:46:53 +0100
commit3f8ebf70b193f4391a01d7412324a10e4faa56a2 (patch)
treed65eb74cbe46be6813afdf9907de5941cbbb9a4d /searx/utils.py
parenteb33ae6893ef9d5081b1ddd1119e7047642a40af (diff)
downloadsearxng-3f8ebf70b193f4391a01d7412324a10e4faa56a2.tar.gz
searxng-3f8ebf70b193f4391a01d7412324a10e4faa56a2.zip
[fix] pylint: use "raise ... from ..."
Diffstat (limited to 'searx/utils.py')
-rw-r--r--searx/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/searx/utils.py b/searx/utils.py
index 057e9d004..3172ad8f3 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -522,7 +522,7 @@ def get_xpath(xpath_spec):
try:
result = XPath(xpath_spec)
except XPathSyntaxError as e:
- raise SearxXPathSyntaxException(xpath_spec, str(e.msg))
+ raise SearxXPathSyntaxException(xpath_spec, str(e.msg)) from e
xpath_cache[xpath_spec] = result
return result
@@ -553,7 +553,7 @@ def eval_xpath(element, xpath_spec):
return xpath(element)
except XPathError as e:
arg = ' '.join([str(i) for i in e.args])
- raise SearxEngineXPathException(xpath_spec, arg)
+ raise SearxEngineXPathException(xpath_spec, arg) from e
def eval_xpath_list(element, xpath_spec, min_len=None):