summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
authornecoro <>2007-06-03 08:30:24 +0000
committernecoro <>2007-06-03 08:30:24 +0000
commit665d3402a28ad0e493f8d3da886cc8ec9bdd4923 (patch)
tree6bcf60ccbfceb5df0ca5f245f78a48404c5909a7 /portato/helper.py
parent6b2c924811ec18f9e2132b90320bf2ddacf4c217 (diff)
downloadportato-665d3402a28ad0e493f8d3da886cc8ec9bdd4923.tar.gz
portato-665d3402a28ad0e493f8d3da886cc8ec9bdd4923.tar.bz2
portato-665d3402a28ad0e493f8d3da886cc8ec9bdd4923.zip
nomsg
Diffstat (limited to 'portato/helper.py')
-rw-r--r--portato/helper.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/portato/helper.py b/portato/helper.py
index 40aff44..f327f75 100644
--- a/portato/helper.py
+++ b/portato/helper.py
@@ -10,8 +10,7 @@
#
# Written by René 'Necoro' Neumann <necoro@necoro.net> et.al.
-import traceback, os.path, sys
-from itertools import chain
+import traceback, os.path, sys, types
DEBUG = True
@@ -99,7 +98,14 @@ def flatten (listOfLists):
@returns: flattend list
@rtype: list"""
- return list(chain(*listOfLists))
+ if type(listOfLists) != types.ListType:
+ return [listOfLists]
+
+ ret = []
+ for r in listOfLists:
+ ret.extend(flatten(r))
+
+ return ret
def unique_array(s):
"""Stolen from portage_utils: