diff options
author | Avinash Raghuthu <avinash.raghuthu@progress.com> | 2019-01-10 00:53:41 +0530 |
---|---|---|
committer | Avinash Raghuthu <avinash.raghuthu@progress.com> | 2019-01-10 00:53:41 +0530 |
commit | 184aff50e02064596758f8a72ae3c557a407ec2f (patch) | |
tree | 3c4ccebce5470973b91ac1cb81045ab49d2e9504 | |
parent | 3c0389585a4819383e7ea669428ddb746cd790a6 (diff) | |
download | pluginbase-184aff50e02064596758f8a72ae3c557a407ec2f.tar.gz |
get_searchpath function corrected for recursive directories retrieval
-rw-r--r-- | pluginbase.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pluginbase.py b/pluginbase.py index 05d582e..fd849e2 100644 --- a/pluginbase.py +++ b/pluginbase.py @@ -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 |