From f8abe6aa77c0bc80f899cbec24cdedb297f28844 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 27 Aug 2012 20:52:52 -0400 Subject: [PATCH] util:plugin: modnames() should only list *.py or *.pyc files. By appending '.py' to *everything*, it was listing '__pycache__' for Python 3. --- libbe/util/plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libbe/util/plugin.py b/libbe/util/plugin.py index ba563eb..ca5686d 100644 --- a/libbe/util/plugin.py +++ b/libbe/util/plugin.py @@ -75,7 +75,9 @@ def modnames(prefix): else: modfiles = os.listdir(os.path.join(_PLUGIN_PATH, *components)) # normalize .py/.pyc extensions and sort - modfiles = sorted(set(os.path.splitext(f)[0] + '.py' for f in modfiles)) + base_ext = [os.path.splitext(f) for f in modfiles] + modfiles = sorted(set( + base + '.py' for base,ext in base_ext if ext in ['.py', '.pyc'])) for modfile in modfiles: if modfile.startswith('.') or not modfile: continue # the occasional emacs temporary file or .* file -- 2.26.2