From: Zac Medico Date: Sat, 31 Oct 2009 19:15:54 +0000 (-0000) Subject: Make cacheddir() always behave like EmptyOnError is True, since listdir() X-Git-Tag: v2.2_rc48~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3d31b473743ff7c1f28540d06cac473e67e0a73b;p=portage.git Make cacheddir() always behave like EmptyOnError is True, since listdir() doesn't handle a None return value correctly. svn path=/main/trunk/; revision=14755 --- diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 53c2064a3..ea8164631 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