MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _register_alias_module

Method _register_alias_module

apps/plugins/loader.py:736–752  ·  view source on GitHub ↗
(
        self,
        alias_name: Optional[str],
        module: Any,
        path: str,
        *,
        force: bool = False,
    )

Source from the content-addressed store, hash-verified

734 self._register_alias_module(alias, pkg, path)
735
736 def _register_alias_module(
737 self,
738 alias_name: Optional[str],
739 module: Any,
740 path: str,
741 *,
742 force: bool = False,
743 ) -> None:
744 if not alias_name:
745 return
746 if self._is_reserved_module_name(alias_name, path):
747 return
748 if alias_name in sys.modules:
749 if not force:
750 return
751 self._unload_alias(alias_name)
752 sys.modules[alias_name] = module
753
754 def _is_reserved_module_name(self, name: str, path: str) -> bool:
755 if name in sys.builtin_module_names:

Callers 2

_load_pluginMethod · 0.95

Calls 2

_unload_aliasMethod · 0.95

Tested by

no test coverage detected