Mercurial > gub
changeset 5400:d93c380086a2
misc.py: find-files fix.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Fri, 24 Jul 2009 13:54:40 +0200 |
parents | 385af1bd3996 |
children | 1bdd1f9d7f9e |
files | gub/misc.py |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gub/misc.py Fri Jul 24 13:54:22 2009 +0200 +++ b/gub/misc.py Fri Jul 24 13:54:40 2009 +0200 @@ -244,8 +244,13 @@ def find_only_files_or_dirs (dir, file_test, file_or_dir_test): if type (file_test) == type (''): file_test = re.compile (file_test) +# Hmm, file_test mutates into the later assigned function +# def match (f): +# return file_test.search (f) +# match = lambda f: file_test.search (f) + file_test_re = file_test def match (f): - return test.search (f) + return file_test_re.search (f) if type (file_test) != type (match): file_test = match def test (f):