Code needs to take into account possibility that self.ignore is None.
- mulhern
----- Original Message -----
From: "Vratislav Podzimek" <vpodzime(a)redhat.com>
To: anaconda-patches(a)lists.fedorahosted.org
Cc: "Anne Mulhern" <amulhern(a)redhat.com>
Sent: Monday, January 26, 2015 6:47:17 AM
Subject: [blivet][master] Use list comprehension instead of filter+lambda in makebumpver
From: Anne Mulhern <amulhern(a)redhat.com>
Signed-off-by: Vratislav Podzimek <vpodzime(a)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