pynsive/plugin/loader.py
def load_module(self, module_name):
        """
        Loads a module's code and sets the module's expected hidden
        variables. For more information on these variables and what they
        are for, please see PEP302.

        :param module_name: the full name of the module to load
        """
        if module_name != self.module_name:
            raise LoaderError(
                'Requesting a module that the loader is unaware of.')

        if module_name in sys.modules:
            return sys.modules[module_name]

        module = self.load_module_py_path(module_name, self.load_target)
        if self.is_pkg:
            module.__path__ = [self.module_path]
            module.__package__ = module_name
        else:
            module.__package__ = module_name.rpartition('.')[0]

        sys.modules[module_name] = module
        return module
def load_module(self, module_name):
        """
        Loads a module's code and sets the module's expected hidden
        variables. For more information on these variables and what they
        are for, please see PEP302.

        :param module_name: the full name of the module to load
        """
        if module_name != self.module_name:
            raise LoaderError(
                'Requesting a module that the loader is unaware of.')

        if module_name in sys.modules:
            return sys.modules[module_name]

        module = self.load_module_py_path(module_name, self.load_target)
        if self.is_pkg:
            module.__path__ = [self.module_path]
            module.__package__ = module_name
        else:
            module.__package__ = module_name.rpartition('.')[0]

        sys.modules[module_name] = module
        return module
Loads a module's code and sets the module's expected hidden
        variables. For more information on these variables and what they
        are for, please see PEP302.

        :param module_name: the full name of the module to load