From: Zac Medico Date: Fri, 29 Jun 2007 21:30:10 +0000 (-0000) Subject: Test for existence of the getRepositories method since bindbapi doesn't have it atm. X-Git-Tag: v2.2_pre1~1116 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=80d3c3e6fd8e1097f980e085a40cb49dd90ba4be;p=portage.git Test for existence of the getRepositories method since bindbapi doesn't have it atm. svn path=/main/trunk/; revision=7093 --- diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 7bc2c686e..64fafbb57 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -1701,7 +1701,8 @@ class dblink(object): # do we have a origin repository name for the current package repopath = os.sep.join(self.settings["O"].split(os.sep)[:-2]) - if mydbapi != None: + # bindbapi has no getRepositories() method + if mydbapi and hasattr(mydbapi, "getRepositories"): for reponame in mydbapi.getRepositories(): if mydbapi.getRepositoryPath(reponame) == repopath: fd = open(os.path.join(self.dbtmpdir, "repository"), "w")