summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-09 17:41:10 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-09 17:41:10 -0700
commitfd58bfea4874ef364d172bcb5dfe788452c06a1c (patch)
tree008bce566770729a47897a8ab62ff4d6eeae592f
parent5acf89e806372305dd77226e09b987f1b9c210d7 (diff)
downloadportage-fd58bfea4874ef364d172bcb5dfe788452c06a1c.tar.gz
portage-fd58bfea4874ef364d172bcb5dfe788452c06a1c.tar.bz2
portage-fd58bfea4874ef364d172bcb5dfe788452c06a1c.zip
In cp_list(), use basestring for ininstance check on the mytree
parameter, and assume it's iterable if it's not a string.
-rw-r--r--pym/portage/dbapi/porttree.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 77c88c85a..b0cd5f49a 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -44,6 +44,7 @@ import sys
import warnings
if sys.hexversion >= 0x3000000:
+ basestring = str
long = int
def _src_uri_validate(cpv, eapi, src_uri):
@@ -907,11 +908,12 @@ class portdbapi(dbapi):
mysplit = mycp.split("/")
invalid_category = mysplit[0] not in self._categories
d={}
- if mytree:
- if isinstance(mytree, str):
+ if mytree is not None:
+ if isinstance(mytree, basestring):
mytrees = [mytree]
- elif not isinstance(mytree, list):
- raise AssertionError("Invalid input type: %s" %str(type(mytree)))
+ else:
+ # assume it's iterable
+ mytrees = mytree
else:
mytrees = self.porttrees
for oroot in mytrees: