Skip to content

Commit 1df26b5

Browse files
author
rkern
committed
BUG: Handle empty lists of skip-dirs and skip-exts correctly. Thanks to Val Kalatsky for finding the bug.
git-svn-id: https://svn.enthought.com/svn/sandbox/grin/trunk@83 b5260ef8-a2c4-4e91-82fd-f242746c304a
1 parent 14211ea commit 1df26b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

grin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,12 +906,15 @@ def get_grind_arg_parser(parser=None):
906906
def get_recognizer(args):
907907
""" Get the file recognizer object from the configured options.
908908
"""
909+
# Make sure we have empty sets when we have empty strings.
910+
skip_dirs = set([x for x in args.skip_dirs.split(',') if x])
911+
skip_exts = set([x for x in args.skip_exts.split(',') if x])
909912
fr = FileRecognizer(
910913
skip_hidden_files=args.skip_hidden_files,
911914
skip_backup_files=args.skip_backup_files,
912915
skip_hidden_dirs=args.skip_hidden_dirs,
913-
skip_dirs=set(args.skip_dirs.split(',')),
914-
skip_exts=set(args.skip_exts.split(',')),
916+
skip_dirs=skip_dirs,
917+
skip_exts=skip_exts,
915918
skip_symlink_files=not args.follow_symlinks,
916919
skip_symlink_dirs=not args.follow_symlinks,
917920
)

0 commit comments

Comments
 (0)