diff options
author | Guido van Rossum <guido@python.org> | 1999-04-30 15:14:05 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1999-04-30 15:14:05 (GMT) |
commit | 78608120de9ca75cab19eca12e8c735a5a26fdae (patch) | |
tree | 2050399c31f55721ef24a4250518d4ffc90bd45f | |
parent | 8961bd15295d42ebf203e4a638b9ed0eb92f7865 (diff) | |
download | cpython-78608120de9ca75cab19eca12e8c735a5a26fdae.zip cpython-78608120de9ca75cab19eca12e8c735a5a26fdae.tar.gz cpython-78608120de9ca75cab19eca12e8c735a5a26fdae.tar.bz2 |
Avoid listing files more than once (e.g. foomodule.so has two hits:
once for foo + module.so, once for foomodule + .so).
-rw-r--r-- | Tools/idle/PathBrowser.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/idle/PathBrowser.py b/Tools/idle/PathBrowser.py index b24977f..62470b2 100644 --- a/Tools/idle/PathBrowser.py +++ b/Tools/idle/PathBrowser.py @@ -56,13 +56,14 @@ class PathBrowser(MultiScrolledLists): sorted = [] for suff, mode, flag in suffixes: i = -len(suff) - for name in allnames: + for name in allnames[:]: normed_name = os.path.normcase(name) if normed_name[i:] == suff: mod_name = name[:i] if not modules.has_key(mod_name): modules[mod_name] = None sorted.append((normed_name, name)) + allnames.remove(name) sorted.sort() names = [] for nn, name in sorted: |