code: def build_compare_func(err_logger=None):
      
      def compare_func(filename):
          try:
              return os.path.getmtime(filename)
          except OSError:
              if err_logger is not None:
                  err_logger(filename)
          return -1
      return compare_func
docs: Returns a compare_func that can be passed to MTimeComparator.
  
      The returned compare_func first tries os.path.getmtime(filename),
      then calls err_logger(filename) if that fails. If err_logger is None,
      then it does nothing. err_logger is always called within the context of
      an OSError raised by os.path.getmtime(filename). Information on this
      error can be retrieved by calling sys.exc_info inside of err_logger.