From: James Bunton Date: Sat, 13 Aug 2016 05:22:26 +0000 (+1000) Subject: aptorphan: use generators X-Git-Url: https://code.delx.au/monosys/commitdiff_plain/6cc380776f6668c60ca2f1548ed7c6c3a7631ec4 aptorphan: use generators --- diff --git a/aptorphan b/aptorphan index 0126a43..564cbb6 100755 --- a/aptorphan +++ b/aptorphan @@ -8,12 +8,10 @@ import sys APTORPHAN_PATH = os.path.expanduser("~/.aptorphan") def run(cmd): - result = [] for line in subprocess.check_output(cmd).decode("utf-8").split("\n"): line = line.strip() if line: - result.append(line) - return result + yield line def strip_comment(line): pos = line.find("#")