summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-31 19:44:18 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-31 19:44:18 +0000
commit62de20ca5a90b9fbe883b3aa207d15061ecf5a83 (patch)
treedb3c9228a112063de8fe452bd87b8e6f4319e260
parent96e4cf57b2306372490e167247f7b219c8566afa (diff)
downloadportage-62de20ca5a90b9fbe883b3aa207d15061ecf5a83.tar.gz
portage-62de20ca5a90b9fbe883b3aa207d15061ecf5a83.tar.bz2
portage-62de20ca5a90b9fbe883b3aa207d15061ecf5a83.zip
Make cacheddir() always behave like EmptyOnError is True, since listdir()
doesn't handle a None return value correctly. (trunk r14755) svn path=/main/branches/2.1.7/; revision=14759
-rw-r--r--pym/portage/__init__.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index ed68c65f2..0c867de3f 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -542,13 +542,9 @@ def cacheddir(my_original_path, ignorecvs, ignorelist, EmptyOnError, followSymli
if e.errno == portage.exception.PermissionDenied.errno:
raise portage.exception.PermissionDenied(mypath)
del e
- if EmptyOnError:
- return [], []
- return None, None
+ return [], []
except portage.exception.PortageException:
- if EmptyOnError:
- return [], []
- return None, None
+ return [], []
# Python retuns mtime in seconds, so if it was changed in the last few seconds, it could be invalid
if mtime != cached_mtime or time.time() - mtime < 4:
if mypath in dircache:
@@ -615,7 +611,7 @@ def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelis
@type ignorelist: List
@param followSymlinks: Follow Symlink'd files and directories
@type followSymlinks: Boolean
- @param EmptyOnError: Return [] if an error occurs.
+ @param EmptyOnError: Return [] if an error occurs (deprecated, always True)
@type EmptyOnError: Boolean
@param dirsonly: Only return directories.
@type dirsonly: Boolean