[PATCH blivet] Do not use type() in makebumpver.

Chris Lumens clumens at redhat.com
Tue May 5 20:22:58 UTC 2015


pylint has gotten pickier about this for whatever reason, so we should stop
using it.  Thus, I'm just going to have _getCommitDetail always return a
list and callers of it decide if they just want one element or what.
---
 scripts/makebumpver | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/scripts/makebumpver b/scripts/makebumpver
index 72714dd..01ff2a8 100755
--- a/scripts/makebumpver
+++ b/scripts/makebumpver
@@ -126,9 +126,9 @@ class MakeBumpVer:
         ret = proc[0].strip('\n').split('\n')
 
         if len(ret) == 1 and ret[0].find('@') != -1:
-            ret = ret[0].split('@')[0]
+            ret = [ret[0].split('@')[0]]
         elif len(ret) == 1:
-            ret = ret[0]
+            ret = [ret[0]]
         else:
             ret = [r for r in ret if r != '']
 
@@ -254,11 +254,9 @@ class MakeBumpVer:
             fields = line.split(' ')
             commit = fields[0]
 
-            summary = self._getCommitDetail(commit, "%s")
+            summary = self._getCommitDetail(commit, "%s")[0]
             body = self._getCommitDetail(commit, "%b")
-            if type(body) is not list:
-                body = [body]
-            author = self._getCommitDetail(commit, "%aE")
+            author = self._getCommitDetail(commit, "%aE")[0]
 
             if self.rhel:
                 rhbz = set()
-- 
2.2.2



More information about the anaconda-patches mailing list