From c253d6bdab348d453f40ac462e6b8d9bcd86785f Mon Sep 17 00:00:00 2001 From: AUTOMATIC <16777216c@gmail.com> Date: Wed, 14 Sep 2022 13:20:24 +0300 Subject: [PATCH] do not die on failing to load script #426 --- modules/scripts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)