From 184aff50e02064596758f8a72ae3c557a407ec2f Mon Sep 17 00:00:00 2001 From: Avinash Raghuthu Date: Thu, 10 Jan 2019 00:53:41 +0530 Subject: get_searchpath function corrected for recursive directories retrieval --- pluginbase.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pluginbase.py') 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 -- cgit v1.2.1