Skip to content

Commit

Permalink
Land #18, fix get_searchpath for subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroSteiner committed Feb 2, 2019
2 parents 78b3bd2 + 184aff5 commit db35a53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pluginbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,13 @@ def get_searchpath(path, depth=float('inf'), followlinks=False):
# slow execution when *path* is a large tree and *depth* is a small number
paths = [path]
for dir_entry in os.listdir(path):
path = os.path.join(path, dir_entry)
if not os.path.isdir(path):
sub_path = os.path.join(path, dir_entry)
if not os.path.isdir(sub_path):
continue
if not followlinks and os.path.islink(path):
if not followlinks and os.path.islink(sub_path):
continue
if depth:
paths.extend(get_searchpath(path, depth - 1, followlinks))
paths.extend(get_searchpath(sub_path, depth - 1, followlinks))
return paths


Expand Down

0 comments on commit db35a53

Please sign in to comment.