diff --git a/modules/scripts.py b/modules/scripts.py index 74591baba..de8c5fc3c 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -42,10 +42,10 @@ def load_scripts(basedir): if not os.path.isfile(path): continue - with open(path, "r", encoding="utf8") as file: - text = file.read() - try: + with open(path, "r", encoding="utf8") as file: + text = file.read() + from types import ModuleType compiled = compile(text, path, 'exec') module = ModuleType(filename)