Bug fix: Search only for files as candidates

This commit is contained in:
Alejandro Guirao 2015-02-26 15:31:15 +01:00
parent affb66416f
commit b8cf131375
2 changed files with 31 additions and 1 deletions

View file

@ -176,7 +176,8 @@ class PluginLoader(object):
found = None
for path in [p for p in self._get_paths() if p not in self._searched_paths]:
if os.path.isdir(path):
for potential_file in os.listdir(path):
for potential_file in (f for f in os.listdir(path)
if os.path.isfile(os.path.join(path, f))):
for suffix in suffixes:
if potential_file.endswith(suffix):
full_path = os.path.join(path, potential_file)