def FindPathHook(self, submodule, submodule_fullname, path_entry):
    """Helper for FindModuleRestricted to find a module in a sys.path entry.

    Args:
      submodule:
      submodule_fullname:
      path_entry: A single sys.path entry, or None representing the builtins.

    Returns:
      Either None (if nothing was found), or a triple (source_file, path_name,
      description).  See the doc string for FindModuleRestricted() for the
      meaning of the latter.
    """
    if path_entry is None:

      if submodule_fullname in sys.builtin_module_names:
        try:
          result = self._imp.find_module(submodule)
        except ImportError:
          pass
        else:

          source_file, pathname, description = result
          suffix, mode, file_type = description
          if file_type == self._imp.C_BUILTIN:
            return result

      return None





    if path_entry in sys.path_importer_cache:
      importer = sys.path_importer_cache[path_entry]
    else:

      importer = None
      for hook in sys.path_hooks:
        try:
          importer = hook(path_entry)

          break
        except __HOLE__:

          pass

      sys.path_importer_cache[path_entry] = importer

    if importer is None:

      try:
        return self._imp.find_module(submodule, [path_entry])
      except ImportError:
        pass
    else:

      loader = importer.find_module(submodule_fullname)
      if loader is not None:




        return (loader, None, (None, None, None))


    return None
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/dev_appserver_import_hook.py/HardenedModulesHook.FindPathHook