Loading searx/engines/json_engine.py +1 −1 Original line number Diff line number Diff line from collections import Iterable from collections.abc import Iterable from json import loads from urllib.parse import urlencode from searx.utils import to_string Loading searx/utils.py +6 −3 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ import os import sys import re import json import importlib from imp import load_source from numbers import Number from os.path import splitext, join from io import open Loading Loading @@ -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 Loading Loading
searx/engines/json_engine.py +1 −1 Original line number Diff line number Diff line from collections import Iterable from collections.abc import Iterable from json import loads from urllib.parse import urlencode from searx.utils import to_string Loading
searx/utils.py +6 −3 Original line number Diff line number Diff line Loading @@ -3,8 +3,8 @@ import os import sys import re import json import importlib from imp import load_source from numbers import Number from os.path import splitext, join from io import open Loading Loading @@ -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 Loading