(name, path=None)
return spec.loader
Return the loader for the specified module.

    This is a backward-compatible wrapper around find_spec().

    This function is deprecated in favor of importlib.util.find_spec().
Return the loader for the specified module.
Return the loader for the specified module .
def find_loader(name, path=None):
    """Return the loader for the specified module.

    This is a backward-compatible wrapper around find_spec().

    This function is deprecated in favor of importlib.util.find_spec().

    """
    warnings.warn('Deprecated since Python 3.4 and slated for removal in '
                  'Python 3.12; use importlib.util.find_spec() instead',
                  DeprecationWarning, stacklevel=2)
    try:
        loader = sys.modules[name].__loader__
        if loader is None:
            raise ValueError('{}.__loader__ is None'.format(name))
        else:
            return loader
    except KeyError:
        pass
    except AttributeError:
        raise ValueError('{}.__loader__ is not set'.format(name)) from None

    spec = _bootstrap._find_spec(name, path)
    # We won't worry about malformed specs (missing attributes).
    if spec is None:
        return None
    if spec.loader is None:
        if spec.submodule_search_locations is None:
            raise ImportError('spec for {} missing loader'.format(name),
                              name=name)
        raise ImportError('namespace packages do not have loaders',
                          name=name)
    return spec.loader
def find_loader ( name , path = None ) : warnings . warn ( 'Deprecated since Python 3.4 and slated for removal in ' 'Python 3.12; use importlib.util.find_spec() instead' , DeprecationWarning , stacklevel = 2 ) try : loader = sys . modules [ name ] . __loader__ if loader is None : raise ValueError ( '{}.__loader__ is None' . format ( name ) ) else : return loader except KeyError : pass except AttributeError : raise ValueError ( '{}.__loader__ is not set' . format ( name ) ) from None spec = _bootstrap . _find_spec ( name , path ) # We won't worry about malformed specs (missing attributes). if spec is None : return None if spec . loader is None : if spec . submodule_search_locations is None : raise ImportError ( 'spec for {} missing loader' . format ( name ) , name = name ) raise ImportError ( 'namespace packages do not have loaders' , name = name ) return spec . loader