From: Zac Medico Date: Tue, 10 Aug 2010 00:41:10 +0000 (-0700) Subject: In cp_list(), use basestring for ininstance check on the mytree X-Git-Tag: v2.2_rc68~351 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fd58bfea4874ef364d172bcb5dfe788452c06a1c;p=portage.git In cp_list(), use basestring for ininstance check on the mytree parameter, and assume it's iterable if it's not a string. --- 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: