From a62ee23fcd9a4688d8f920c962edf071c704428b Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Tue, 7 Aug 2018 03:31:44 -0700 Subject: [PATCH] utils: pylint updates Signed-off-by: David Aguilar --- cola/utils.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cola/utils.py b/cola/utils.py index 0252f7b6..d16bb790 100644 --- a/cola/utils.py +++ b/cola/utils.py @@ -105,12 +105,13 @@ def grep(pattern, items, squash=True): matched.append(subitems) if isdict: - return matchdict + result = matchdict + elif squash and len(matched) == 1: + result = matched[0] else: - if squash and len(matched) == 1: - return matched[0] - else: - return matched + result = matched + + return result def basename(path): @@ -158,6 +159,7 @@ def join(*paths): """ return '/'.join(paths) + def pathset(path): """Return all of the path components for the specified path @@ -344,8 +346,8 @@ def slice_fn(input_items, map_fn): class seq(object): - def __init__(self, seq): - self.seq = seq + def __init__(self, sequence): + self.seq = sequence def index(self, item, default=-1): try: -- 2.11.4.GIT