(name, import_)
return module
Find and load the module.
Find and load the module.
Find and load the module .
def _find_and_load(name, import_):
    """Find and load the module."""
    with _ModuleLockManager(name):
        module = sys.modules.get(name, _NEEDS_LOADING)
        if module is _NEEDS_LOADING:
            return _find_and_load_unlocked(name, import_)

    if module is None:
        message = ('import of {} halted; '
                   'None in sys.modules'.format(name))
        raise ModuleNotFoundError(message, name=name)

    _lock_unlock_module(name)
    return module
def _find_and_load ( name , import_ ) : with _ModuleLockManager ( name ) : module = sys . modules . get ( name , _NEEDS_LOADING ) if module is _NEEDS_LOADING : return _find_and_load_unlocked ( name , import_ ) if module is None : message = ( 'import of {} halted; ' 'None in sys.modules' . format ( name ) ) raise ModuleNotFoundError ( message , name = name ) _lock_unlock_module ( name ) return module