[blivet][master] Use list comprehension instead of filter+lambda in makebumpver

Vratislav Podzimek vpodzime at redhat.com
Mon Jan 26 11:47:17 UTC 2015


From: Anne Mulhern <amulhern at redhat.com>

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 scripts/makebumpver | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/makebumpver b/scripts/makebumpver
index 07ce065..40ad7ee 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -239,10 +239,8 @@ class MakeBumpVer:
                                  x.find('Merge branch') != 41,
                        proc[0].strip('\n').split('\n'))
 
-        if self.ignore and self.ignore != '':
-            startswith_commit = lambda x: not x.startswith(commit)
-            for commit in self.ignore.split(','):
-                lines = filter(startswith_commit, lines)
+        ignore_commits = self.ignore.split(',')
+        lines = [l for l in lines if not any(l.startswith(c) for c in ignore_commits)]
 
         rpm_log = []
         bad_bump = False
-- 
2.1.0



More information about the anaconda-patches mailing list