From 58ae97c54525b1572f2c96ad81f28bca69b8edc2 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 29 Oct 2007 00:08:28 +0000 Subject: Make portdbapi.cp_list() use os.listdir() instead of portage.listdir() since portage.listdir() has unnecessary overhead and it's cache isn't needed since cp_list() has it's own cache. svn path=/main/trunk/; revision=8336 --- pym/portage/dbapi/porttree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pym') diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index 84f8c196d..ec38e0850 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -511,7 +511,11 @@ class portdbapi(dbapi): else: mytrees = self.porttrees for oroot in mytrees: - for x in listdir(oroot+"/"+mycp, EmptyOnError=1, ignorecvs=1): + try: + file_list = os.listdir(os.path.join(oroot, mycp)) + except OSError: + continue + for x in file_list: if x.endswith(".ebuild"): pf = x[:-7] ps = pkgsplit(pf) -- cgit v1.2.3-1-g7c22