Skip to content

Commit 6a41d45

Browse files
change regex rule
Signed-off-by: Tatsuhiro Chiba <[email protected]>
1 parent 638291f commit 6a41d45

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crawler/utils/file_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import fnmatch
21
import logging
32
import os
43
import re
@@ -26,8 +25,7 @@ def crawl_files(
2625
root_dir_alias = root_dir
2726
exclude_dirs = [os.path.join(root_dir, d) for d in
2827
exclude_dirs]
29-
exclude_regex = r'|'.join([fnmatch.translate(d)
30-
for d in exclude_dirs]) or r'$.'
28+
exclude_regex = re.compile(r'|'.join([d for d in exclude_dirs]))
3129

3230
# walk the directory hierarchy starting at 'root_dir' in BFS
3331
# order
@@ -72,6 +70,7 @@ def _filetype(fpath, fperm):
7270
}.get(modebit)
7371
return ftype
7472

73+
7574
_filemode_table = (
7675
(
7776
(stat.S_IFLNK, 'l'),

0 commit comments

Comments
 (0)