diff options
author | W. Trevor King <wking@tremily.us> | 2012-08-27 20:52:52 -0400 |
---|---|---|
committer | W. Trevor King <wking@tremily.us> | 2012-08-27 20:52:52 -0400 |
commit | f8abe6aa77c0bc80f899cbec24cdedb297f28844 (patch) | |
tree | 2d91c3fc4e94672a131ac51f9f8e2ec1bcfa1b46 /libbe/util/plugin.py | |
parent | 3f29c1f8b3fac340aa7a4f0bf1abd3a0a241a61a (diff) | |
download | bugseverywhere-f8abe6aa77c0bc80f899cbec24cdedb297f28844.tar.gz |
util:plugin: modnames() should only list *.py or *.pyc files.
By appending '.py' to *everything*, it was listing '__pycache__' for
Python 3.
Diffstat (limited to 'libbe/util/plugin.py')
-rw-r--r-- | libbe/util/plugin.py | 4 |
1 files changed, 3 insertions, 1 deletions
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 |