mirror of https://github.com/python/cpython
use a set for membership testing
This commit is contained in:
parent
4653fb556c
commit
3b95934e05
|
@ -276,12 +276,12 @@ def getsitepackages():
|
|||
environment, and will return a list of full paths.
|
||||
"""
|
||||
sitepackages = []
|
||||
seen = []
|
||||
seen = set()
|
||||
|
||||
for prefix in PREFIXES:
|
||||
if not prefix or prefix in seen:
|
||||
continue
|
||||
seen.append(prefix)
|
||||
seen.add(prefix)
|
||||
|
||||
if sys.platform in ('os2emx', 'riscos'):
|
||||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
||||
|
|
Loading…
Reference in New Issue