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

Brian C. Lane bcl at redhat.com
Wed May 6 02:11:13 UTC 2015


On Tue, May 05, 2015 at 04:22:58PM -0400, Chris Lumens wrote:
> 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

Ack. cleaner that way anyhow.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list