'Generator, yields (pid_file, pids)'

def iter_pid_files(self, **kwargs):

    for pid_file in self.pid_files(**kwargs):
        try:
            pid = int(open(pid_file).read().strip())
        except ValueError:
            pid = None
        (yield (pid_file, pid))
