mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2026-01-08 02:02:36 -08:00
Fix cls.__module__
This commit is contained in:
parent
ff6f4680c4
commit
0f82948e4f
2 changed files with 6 additions and 8 deletions
|
|
@ -9,15 +9,13 @@ loaded_scripts = {}
|
|||
|
||||
|
||||
def load_module(path):
|
||||
module_spec = importlib.util.spec_from_file_location(os.path.basename(path), path)
|
||||
module_name, _ = os.path.splitext(os.path.basename(path))
|
||||
full_module_name = "scripts." + module_name
|
||||
module_spec = importlib.util.spec_from_file_location(full_module_name, path)
|
||||
module = importlib.util.module_from_spec(module_spec)
|
||||
module_spec.loader.exec_module(module)
|
||||
|
||||
loaded_scripts[path] = module
|
||||
|
||||
module_name, _ = os.path.splitext(os.path.basename(path))
|
||||
sys.modules["scripts." + module_name] = module
|
||||
|
||||
loaded_scripts[full_module_name] = module
|
||||
sys.modules[full_module_name] = module
|
||||
return module
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue