summaryrefslogtreecommitdiffstats
path: root/utils.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-11-14 13:25:26 +0100
committerJan Pokorný <jpokorny@redhat.com>2014-11-14 22:11:21 +0100
commit3a3eac0097598bdaad18e081f0359d905f24fed5 (patch)
tree957c69cfec55661eedf56fc0e9f2fa541a39d4af /utils.py
parent904116553df1ac3d3ef5ecc88df33d04be29cf50 (diff)
downloadclufter-3a3eac0097598bdaad18e081f0359d905f24fed5.tar.gz
clufter-3a3eac0097598bdaad18e081f0359d905f24fed5.tar.xz
clufter-3a3eac0097598bdaad18e081f0359d905f24fed5.zip
utils: arg2wrapped: make sure list on input is on output
Previously, the list was deconstructed and reconstructed as a tuple. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils.py b/utils.py
index 67a4c85..f48c42a 100644
--- a/utils.py
+++ b/utils.py
@@ -15,8 +15,9 @@ tuplist = lambda x: isinstance(x, (tuple, list, set))
# turn args into tuple unless single tuplist arg
args2sgpl = \
lambda x=(), *y: x if not y and tuplist(x) else (x, ) + y
-args2combsgpl = arg2wrapped = \
- lambda x=(), *y: x if not y and tuplist(x) and len(x) > 1 else (x, ) + y
+arg2wrapped = \
+ lambda x=(), *y: \
+ x if not y and isinstance(x, tuple) and len(x) > 1 else (x, ) + y
args2unwrapped = \
lambda x=None, *y: x if not y else (x, ) + y
# turn args into tuple unconditionally