summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpencer McIntyre <zeroSteiner@gmail.com>2019-02-02 14:23:06 -0500
committerSpencer McIntyre <zeroSteiner@gmail.com>2019-02-02 14:23:38 -0500
commitdb35a538d2aedeed41bd9d66597490d1907a1759 (patch)
tree5946e9c447fa87c7a8df4db0f0ab3306552ef1c7
parent78b3bd2160ad6e5250309cbc558ffc40f2467bbe (diff)
parent184aff50e02064596758f8a72ae3c557a407ec2f (diff)
downloadpluginbase-db35a538d2aedeed41bd9d66597490d1907a1759.tar.gz
Land #18, fix get_searchpath for subdirectories
-rw-r--r--pluginbase.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pluginbase.py b/pluginbase.py
index e42092f..6bfeb66 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