Gary,

Thank you for the response. I made a small typo in my original post, which you correctly picked up. My original generator actually did not have the stdout parameter (see below). Only the new generator has this parameter, as it's now being passed into the generator from the caller's execution of subprocess.check_output.

def _raw_data(cl, *, opath=None, timeout=timeout):
stdout = subprocess.check_output(cl, universal_newlines=True, timeout=timeout)

    if opath is None:
        for line in stdout.splitlines():
            yield line.strip()
    else:
        with open(opath) as f:
            for line in f:
                yield line.strip()


Peter
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to