mirror of
https://github.com/python/cpython.git
synced 2025-11-26 21:33:10 +00:00
use a set for membership testing
This commit is contained in:
parent
4653fb556c
commit
3b95934e05
1 changed files with 2 additions and 2 deletions
|
|
@ -276,12 +276,12 @@ def getsitepackages():
|
||||||
environment, and will return a list of full paths.
|
environment, and will return a list of full paths.
|
||||||
"""
|
"""
|
||||||
sitepackages = []
|
sitepackages = []
|
||||||
seen = []
|
seen = set()
|
||||||
|
|
||||||
for prefix in PREFIXES:
|
for prefix in PREFIXES:
|
||||||
if not prefix or prefix in seen:
|
if not prefix or prefix in seen:
|
||||||
continue
|
continue
|
||||||
seen.append(prefix)
|
seen.add(prefix)
|
||||||
|
|
||||||
if sys.platform in ('os2emx', 'riscos'):
|
if sys.platform in ('os2emx', 'riscos'):
|
||||||
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue