diff options
Diffstat (limited to 'backend/src/plugin')
| -rw-r--r-- | backend/src/plugin/sandboxed_plugin.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/backend/src/plugin/sandboxed_plugin.py b/backend/src/plugin/sandboxed_plugin.py index d44794fa..adf9f802 100644 --- a/backend/src/plugin/sandboxed_plugin.py +++ b/backend/src/plugin/sandboxed_plugin.py @@ -3,7 +3,7 @@ from signal import SIGINT, signal from importlib.util import module_from_spec, spec_from_file_location from json import dumps, loads from logging import getLogger -from sys import exit, path as syspath +from sys import exit, path as syspath, modules as sysmodules from traceback import format_exc from asyncio import (get_event_loop, new_event_loop, set_event_loop, sleep) @@ -72,6 +72,11 @@ class SandboxedPlugin: # append the plugin's `py_modules` to the recognized python paths syspath.append(path.join(environ["DECKY_PLUGIN_DIR"], "py_modules")) + + #TODO: FIX IN A LESS CURSED WAY + keys = [key.replace("src.", "") for key in sysmodules if key.startswith("src.")] + for key in keys: + sysmodules[key] = sysmodules["src"].__dict__[key] spec = spec_from_file_location("_", self.file) assert spec is not None |
