SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] drop Python 2: use importlib instead of imp.load_source
Alexandre Flament15013e64d8a1
diff --git a/searx/utils.py b/searx/utils.pyindex 0be3c5b00..db17feba9 100644--- a/searx/utils.py+++ b/searx/utils.py@@ -3,8 +3,8 @@ import osimport sysimport reimport json+import importlib-from imp import load_sourcefrom numbers import Numberfrom os.path import splitext, joinfrom io import open@@ -445,8 +445,11 @@ def load_module(filename, module_dir):if modname in sys.modules:del sys.modules[modname]filepath = join(module_dir, filename)- module = load_source(modname, filepath)- module.name = modname+ # and https://docs.python.org/3/library/importlib.html#importing-a-source-file-directly+ spec = importlib.util.spec_from_file_location(modname, filepath)+ module = importlib.util.module_from_spec(spec)+ sys.modules[modname] = module+ spec.loader.exec_module(module)return module