mirror of https://github.com/python/cpython
Avoid listing files more than once (e.g. foomodule.so has two hits:
once for foo + module.so, once for foomodule + .so).
This commit is contained in:
parent
8961bd1529
commit
78608120de
|
@ -56,13 +56,14 @@ class PathBrowser(MultiScrolledLists):
|
||||||
sorted = []
|
sorted = []
|
||||||
for suff, mode, flag in suffixes:
|
for suff, mode, flag in suffixes:
|
||||||
i = -len(suff)
|
i = -len(suff)
|
||||||
for name in allnames:
|
for name in allnames[:]:
|
||||||
normed_name = os.path.normcase(name)
|
normed_name = os.path.normcase(name)
|
||||||
if normed_name[i:] == suff:
|
if normed_name[i:] == suff:
|
||||||
mod_name = name[:i]
|
mod_name = name[:i]
|
||||||
if not modules.has_key(mod_name):
|
if not modules.has_key(mod_name):
|
||||||
modules[mod_name] = None
|
modules[mod_name] = None
|
||||||
sorted.append((normed_name, name))
|
sorted.append((normed_name, name))
|
||||||
|
allnames.remove(name)
|
||||||
sorted.sort()
|
sorted.sort()
|
||||||
names = []
|
names = []
|
||||||
for nn, name in sorted:
|
for nn, name in sorted:
|
||||||
|
|
Loading…
Reference in New Issue