Mercurial > piecrust2
changeset 546:6ef89b31ddda 2.0.0b3
internal: Fix a severe bug with the file-system wrappers on OSX.
`os.walk` is expected to support modifying its return values `dirnames` and
`filenames` so that you can filter out items that need to be iterated upon.
I was previously returning a different list in the wrappers, which means
filtering was completely broken.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 01 Aug 2015 08:09:53 -0700 |
parents | 1856e7aa6ce8 |
children | 8c9057bb0fea |
files | piecrust/osutil.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/osutil.py Fri Jul 31 23:35:55 2015 -0700 +++ b/piecrust/osutil.py Sat Aug 01 08:09:53 2015 -0700 @@ -13,8 +13,8 @@ def _walk(top, **kwargs): for dirpath, dirnames, filenames in os.walk(top, **kwargs): dirpath = _from_osx_fs(dirpath) - dirnames = list(map(_from_osx_fs, dirnames)) - filenames = list(map(_from_osx_fs, filenames)) + dirnames[:] = list(map(_from_osx_fs, dirnames)) + filenames[:] = list(map(_from_osx_fs, filenames)) yield dirpath, dirnames, filenames def _listdir(path='.'):