From 629c1de8d5ff5d732cf753108eb07f251effe2c9 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 13 Dec 2020 00:05:32 +0100 Subject: [PATCH] use os.listdir --- pandora_client/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 7332874..decda2c 100755 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -226,7 +226,11 @@ class Client(object): def load_plugins(self, base=os.path.join(utils.basedir(), 'client.d')): global parse_path, example_path, ignore_file, sync_extensions, encode base = os.path.expanduser(base) - for path in sorted(glob('%s%s*.py' % (base, os.sep))): + for name in sorted(os.listdir(base)): + if not name.endswith('.py'): + continue + path = os.path.join(base, name) + with open(path) as fp: module = imp.load_source(os.path.basename(path).split('.')[0], base, fp) if hasattr(module, 'parse_path'):