add optional list support for mytree to complinment the trees param in cp_list()
authorBrian Dolbec <brian.dolbec@gmail.com>
Mon, 9 Aug 2010 08:05:03 +0000 (01:05 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 10 Aug 2010 00:40:26 +0000 (17:40 -0700)
pym/portage/dbapi/porttree.py

index 956d6a80a8f114ebfdf335bcf25d9c32f153a954..77c88c85ad40e18e5540c92293009852bb0fd792 100644 (file)
@@ -908,7 +908,10 @@ class portdbapi(dbapi):
                invalid_category = mysplit[0] not in self._categories
                d={}
                if mytree:
-                       mytrees = [mytree]
+                       if isinstance(mytree, str):
+                               mytrees = [mytree]
+                       elif not isinstance(mytree, list):
+                               raise  AssertionError("Invalid input type: %s" %str(type(mytree)))
                else:
                        mytrees = self.porttrees
                for oroot in mytrees: