File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,10 @@ def find_assignments(self,
361
361
# Locate all matching directories using a glob
362
362
dirs = list (
363
363
filter (
364
- lambda p : p .is_dir () and not is_ignored (p .relative_to (self .root ), self .ignore ),
364
+ lambda p : (
365
+ p .is_dir ()
366
+ and not is_ignored (str (p .relative_to (self .root )), self .ignore )
367
+ ),
365
368
Path (self .root ).glob (self .directory_structure .format (** kwargs ))
366
369
)
367
370
)
Original file line number Diff line number Diff line change @@ -272,11 +272,14 @@ def self_owned(path):
272
272
return get_osusername () == find_owner (os .path .abspath (path ))
273
273
274
274
275
- def is_ignored (filename : str , ignore_globs : List [str ]) -> bool :
275
+ def is_ignored (filename : str , ignore_globs : List [str ] = None ) -> bool :
276
276
"""Determines whether a filename should be ignored, based on whether it
277
277
matches any file glob in the given list. Note that this only matches on the
278
278
base filename itself, not the full path."""
279
279
280
+ if ignore_globs is None :
281
+ return False
282
+
280
283
basename = os .path .basename (filename )
281
284
for expr in ignore_globs :
282
285
if fnmatch .fnmatch (basename , expr ):
You can’t perform that action at this time.
0 commit comments